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

Answers were Sorted based on User's Feedback



i am new to qtp i do not know how to write script how to write the code to login if it fails how t..

Answer / 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

i am new to qtp i do not know how to write script how to write the code to login if it fails how t..

Answer / satyaprasad

dialog("login").active
dialog("login").winedit("username").set"asdf"
dialog("login).winedit("password").setsecure"amxcer013m34ee"
dialog("login").winbutton("ok").click

Note:for descriptive programing we must add the objects of
the application to "Object repository"

Is This Answer Correct ?    2 Yes 1 No

i am new to qtp i do not know how to write script how to write the code to login if it fails how t..

Answer / nanda

HI...What Satya..we dont need add objects to repository for
descriptive programming.

come to scenario....

dialog("login").winedit("Agent Name:").set datatable.value(1)
dialog("login").winedit("Password:").setsecure
crypt.encrypt(datatable.value(2))
dialog("login").winbutton("OK").click

If dialog("Login").dialog("text:=Flight Reservations").exist
then
dialog("Login").dialog("text:=Flight
Reservations").winbutton("text:=OK").click
dialog("Login").WinButton("Cancel").click
Else
window("Flight reservation").close
end if

like this we can handle pop up messages...

If any queries..

nanda.dreddy@gmail.com

Is This Answer Correct ?    0 Yes 0 No

i am new to qtp i do not know how to write script how to write the code to login if it fails how t..

Answer / pravati

Browser().page().webedit().set "mailid"
Browser().page().webedit().set "password"
Browser().page().webbutton().click
if
Browser().Page().Link("Home").Click exist
then
msgbox "login pass"
else msgbox "login fail"

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

If there are 100 checkboes in a page then how can we select 10th & 11th & 14th chexkboxes at once through descriptive programing in QTP using vb script. Please send the answers...

5 Answers   NTT Data,


In qtp, how you can exit for loop?

0 Answers  


Hi, I am supposed to automate mainframe application through qtp. I do not know how to start abt it. Can you plz help me in first initializing the process or do you anybody have a guide book or a link which guides me through the process of automating the mainframe applications and things involved in it.

0 Answers  


What is the diff between doing parametarisation using Data Driven wizard or manually. when do we go for manual para...and when do we use Data driver wizard..can anybody answer it ..Thanks in advance

6 Answers   Siemens,


How to check which add-ins are associated with a test in qtp?

0 Answers  






In a Web appl, on a page, there are student names & details listed.On clicking sort button,details are sorted on Names.How do u verify htat sorting is done by using QTP?

1 Answers   IBM,


Can u call winRunner scripts from QTP?

4 Answers  


There is one login screen,after accepting valid username and apassword, it will show the next screen. In the 2nd screen u r having 2 combo boxes, U have to select any item from these, and click OK button. After closing that, it will show the 3rd screen. If u click CANCEL button from 2nd screen it will show the first screen. Write QTP script for it???

1 Answers   Sonata,


Could any one explain about the nested actions in QTP? This question is asked by Qualitree and CA

3 Answers   CA, Qualtree Solutions,


what is meant by "Parameterization technique"?

4 Answers   KH, Mind Tree,


interviwer asks what is data table? my ans is Data table is an internal Excel file of QTP...intervier not happy with this also? can u post any other answer?

3 Answers   Accenture,


How to handle the exceptions using the recovery scenario manager in qtp?

0 Answers  


Categories