HOW CAN WE GET THE VALUE OF TEXT BOX IN QTP? can you give me
sample script for this where there is some condition. like
if "text" THEN msgbox() else endif
Answers were Sorted based on User's Feedback
Answer / shiva kumar dokka
if it is a windows based application, then it will be in
this way :
x= Window("Windowname").winedit("editboxname").Getvisibletext
msgbox x (or)
if it is webbased application then :
x =
Browser("Browsername").Page("Pagename").Webedit("Webeditboxname").GetROProperty("value")
msgbox x
Is This Answer Correct ? | 29 Yes | 8 No |
Answer / pooja
Using Object Spy find where u get the value for the
textbox, i.e in "text" property or "Value" property...
use "text" or "value" accordingly Getroproperty("text") or
Getroproperty("value")
If u want to chk whether the value in the text box
is "sunday" then....
a=Browser().page().frame().webedit().getroproperty("value")
if a=="sunday" then
msgbox ("displayed message is sunday")
else
msgbox ("msg is not sunday")
end if
Is This Answer Correct ? | 20 Yes | 8 No |
Answer / a.thirumalareddy@gmail.com
systemutil.Run "iexplore.exe", "newtours.demoaut.com"
getValue=Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").GetROProperty("name")
msgbox getValue
If name<>userName Then
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").Set "thirumala"
Else
Reporter.ReportEvent micfail, "check edit box existancy", "Edit box is not existed"
End If
Is This Answer Correct ? | 9 Yes | 2 No |
Answer / sree
val=window("customer").edit("").GetTOProperty("text")
msgbox val
if (val=true) then
msgbox "pass"
else
msgbox "fail"
Is This Answer Correct ? | 10 Yes | 5 No |
a=inputbox("text")
msgbox a
if (a=true) then
msgbox "pass"
else
msgbox "fail"
Is This Answer Correct ? | 4 Yes | 11 No |
Answer / sdf
textProp=Browser("").Page().WebEdit().GetROProperties
("text")
If textProp<>"password" Then
msgbox "Enter Proper Password"
End If
Is This Answer Correct ? | 11 Yes | 19 No |
Answer / ramakrishna
x=inputbox("text")
mdgnox x
if (x=true) then
msgbox "pass"
else
msgbox "fail"
Is This Answer Correct ? | 7 Yes | 21 No |
A dialog is diplays " Transaction 254689 has been successfully completed" How to get the transaction ID from the message ?
How to change the priorities of the recovery scenario properties?
Extract a word from a sentenece?
what are the difference ways of parameterising?
For the below written code , i want to be stop the loop (ex:10 times), but it is focusing to first line of the code & generating error. vbwindow("vbname:=frmMain").Type micAltDwn + "6" + "2" + "D" +micAltUp 'wiil open the particular window in application vbwindow("vbname:=frmDeduction").vbbutton("vbname:=cmdNew").Click DataTable.ImportSheet"F:\QTP VBScript\Form 26-1.xls","Deduction",Global RowCount = DataTable.GetSheet("Global").GetRowCount i=RowCount For j =1 to i 'vbwindow("vbname:=frmDeduction").WinObject("nativeclass:=DataComboWndClass","abs_y:= 187").Type DataTable("Name", dtGlobalSheet) vbwindow("vbname:=frmDeduction").ActiveX("acx_name:=DataCombo","abs_y:= 187").Type DataTable("Name", dtGlobalSheet) vbwindow("vbname:=frmDeduction").ActiveX("acx_name:=DataCombo","abs_y:= 187").Type micF4 vbwindow("vbname:=frmDeduction").ActiveX("acx_name:=DataCombo","abs_y:= 187").Type micTab vbwindow("vbname:=frmDeduction").ActiveX("acx_name:=DataCombo","abs_y:= 216").Type micF4 vbwindow("vbname:=frmDeduction").ActiveX("acx_name:=DataCombo","abs_y:= 216").Type DataTable("Section", dtGlobalSheet) vbwindow("vbname:=frmDeduction").ActiveX("acx_name:=DataCombo","abs_y:= 216").Type micTab vbwindow("vbname:=frmDeduction").VbEdit("vbname:=txtAmtOfPay").Set DataTable("Amount_of_Payment", dtGlobalSheet) vbwindow("vbname:=frmDeduction").VbEdit("vbname:=txtAmtPaidDate").Set DataTable("Amount_PaidCredited_Date", dtGlobalSheet) vbwindow("vbname:=frmDeduction").VbEdit("vbname:=txtAmtPaidDate").Type micTab vbwindow("vbname:=frmDeduction").ActiveX("acx_name:=DataCombo","abs_y:= 316").Type micF4 vbwindow("vbname:=frmDeduction").ActiveX("acx_name:=DataCombo","abs_y:= 316").Type DataTable("Deduction_is", dtGlobalSheet) vbwindow("vbname:=frmDeduction").ActiveX("acx_name:=DataCombo","abs_y:= 316").Type micTab vbwindow("vbname:=frmDeduction").VbButton("vbname:=cmdSave").Click DataTable.SetNextRow Next vbwindow("vbname:=frmDeduction").VbButton("vbname:=cmdClose").Click
Why VB scripts are used in QTP and TSL in Winrunner, is there any advantage of using VB Scripts
How to open an application through scripting?
what is objectidentification?
How to get Traceability matrix from TD?
How will you handle custom object in QTP?
Hi..friends can anybody write the script for this question... Am having some 20 nos of links in a web application, i want to click some 5,13 & 17th links. So please....can anybody give the answer....??? -->Hani<--
What is the Test Object model in QTP?