i am new to qtp i do not know how to write script
how to write the code to login if it fails how to able
error messages
Answer Posted / shyam.meghansh
if Dialog("Login").Exist then
Dialog("Login").WinEdit("Agent Name:").Set DataTable
("A",dtLocalSheet)
Dialog("Login").WinEdit("Password:").Set DataTable
("B", dtLocalSheet)
Dialog("Login").WinButton("OK").Click
' Check for invalid user and password
If Dialog("Login").Dialog("Flight
Reservations").Exist Then
Dialog("Login").Dialog("Flight
Reservations").WinButton("OK").Click
Reporter.ReportEvent
micfail,"Login","Invalid User /Pwd Check"
msgbox "Invalid User /Pwd Check"
ExitRun(0)
End If
else
Reporter.ReportEvent
micfail,"Login","Login Dialog not exists"
msgbox "Login Dialog not exists"
ExitRun(0)
end if
................. any more question them let me know.......
mail to testingwithshyam@gmail.com
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
I have qtp 9.5 demo ver,I am not able to record the yahoo broeser.so anyone can tell me what setting i have to do in QTP for yahoo brower recording. why its not recognise the object of yahoo browser????
Hi, Can we open a test in qtp10 which is saved in qtp 9.2?
What is the extension of the recovery scenario file in qtp?
How many tabs are available to view your test in a test pane and what are they?
Both static and dynamic arrays are handled by the vb script. Is it true?
Why qtp always start action1 and does not start action?
What is file database?
Which advantages helping QTP to hold the position of "Market Leader" for such a long period?
hi all can anyone explain how to write the code for finding the mandatory columns in table which are having (red*) (red Astrik)
How to use output values in qtp ?
Explain the difference between call to action and copy action?
Call to copy of an action and call to existing action… i know the diff but in real project how to use..? i want live scenario.pls help me..
What is environment variable in qtp and why to use it?
Explain the Different types of QTP test assets and their extensions?
when I try to run below script in QTP "totalPages" value is 2. But i am getting error message (Type mismatch: 'totalPages' Line (): "For i=1 to totalPages".) totalPages=Browser("Name:=User").Page("Title:=User").WebElem ent("innertext:=of.*").GetROProperty("InnerText") msgbox totalPages For i=1 to totalPages rnum=Browser("Name:=User").Page("Title:=User").WebTa ble("column names:=User Name;ID;Last Name;First Name").GetRowWithCellText("store4") If rnum>0 Then r=rnum Exit for End If Browser("Name:=User").Page("Title:=User").WebElement ("html tag:=A","x:=471").Click MsgBox "Exit" Next