Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

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????

2673


Hi, Can we open a test in qtp10 which is saved in qtp 9.2?

1842


What is the extension of the recovery scenario file in qtp?

952


How many tabs are available to view your test in a test pane and what are they?

1028


Both static and dynamic arrays are handled by the vb script. Is it true?

990


Why qtp always start action1 and does not start action?

1043


What is file database?

2116


Which advantages helping QTP to hold the position of "Market Leader" for such a long period?

1792


hi all can anyone explain how to write the code for finding the mandatory columns in table which are having (red*) (red Astrik)

1819


How to use output values in qtp ?

954


Explain the difference between call to action and copy action?

941


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..

1733


What is environment variable in qtp and why to use it?

956


Explain the Different types of QTP test assets and their extensions?

1060


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

3861