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

What is the difference between Datadriven and Parameterization?

8 Answers   Ordain Solutions,


please send detail navigation for merging of object ripositories in QTP 8.2

3 Answers   Infosys, Ordain Solutions,


wt is the difference between global and action excel database in qtp?for example one action is calling another action the second action is using action excell sheet?if it is using global sheet what makes the difference?

2 Answers   Datamatics,


what r the 3 basic factor on which we determine to perform automation

6 Answers   AppLabs,


What is the difference between Normal mode and Fast mode ?

1 Answers   AZTEC,






why we use check points , In qtp we use the any check points , what r they , when and why

1 Answers   Polaris,


Hi friends, In a particular test how many maximum call to new actions we can call?It reusable or normal actions what ever it is .

1 Answers   AppLabs,


How to get Links count in an web application,without descriptive programming?

8 Answers  


I want to know how to execute the descriptive programming in qtp for the webedit object which does not contain attached text property. but i have checked it with name and html id property. Even though it is not executing. it is giving error in object's physical description.

2 Answers  


How does QTP identifies the object in the application?

1 Answers   Crea,


WHAT IS A TEST STRATEGY & WHAT IS THE DIFFERENCE BETWEEN TEST STRATEGY & TEST PLAN?

21 Answers   ABM, AZTEC, CTS, Infosys, Nihilent, Orange,


Write the code for,In the page screen we have total 10 Links,out of these I have to click 9th link

0 Answers  


Categories