Hi Friends,
How to trap an error message on Web page through QTP.
Example:- When I put wrong user id or Password on a web
page, I get the error message.
So when I add the error object in Reposatory, every time it
shows as Login Failed Object exist, eventhough using corret
login details.
And if I do the same without adding the object it shows as
object not found.
This might be because while recording QTP takes every new
page as _1 _2 _3 and so on. as below.
Browser("XXXXX").Page("XXXXX_1"). >>login
Browser("XXXXX").Page("XXXXX_2"). >>Inbox
Browser("XXXXX").Page("XXXXX_3"). >>Sent Items
I used below code.
Browser("XXXXX").Page("XXXXX").WebEdit("firstname").Set
strFN
Browser("XXXXX").Page("XXXXX").WebEdit("lastname").Set strLN
Browser("XXXXX").Page("XXXXX").WebEdit("userid").Set
strUserID
Browser("XXXXX").Page("XXXXX").WebEdit("password").Set
strPass
Browser("XXXXX").Page("XXXXX").WebButton("Login >").Click
If Browser("XXXXX").Page("XXXXX_2").Image
("msg_icon_error").Exist 5 Then
Reporter.ReportEvent micFail, "XXXXX", "Login Failed!"
ExitRun (It shows login failed ever after login is passed.
Else
Reporter.ReportEvent micPass, "XXXXX", "Login Successful!"
End If
Please find out a way for me here, and provide me with the
correct code.
Thanks in Advance.
Answer Posted / hokrani
You have to do setting....
Go to Tools > Options
Click on Web tab
Click on 'Page/Frame Options' button
Then select following check box
Ignore non user-input data - Get
Ignore non user-input data - post
and click on 'OK' button.
Once u done this setting, next time page is stored page1,
page2 in OR.
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What VBScript operators, functions, and statements do you use in QuickTest Professional?
How to find the name of the machine where you are running your automation scripts in qtp?
How to check which add-ins are associated with a test in qtp?
what is the diffrence bw qtp architectute and qtp framework?
can any one please tell me which is the best institute in Bangalore to learn QA (crash course)? Thanks
Excel sheet having some datas and some datas present in the application (in table). How will you compare these two datas? Write code to fetch datas from Excel sheet.
wht type of User defined functions or Java Releated functions do we write in VB scripting
i can done the project with QTP in that time i can say how many members in my team size?
How we can import data from database?
Print the Prime numbers in below format only up to 20(Need commas also) 1,2,3,5,7,9,11,13,17,19
Name the properties you would use for identifying a browser and page when using descriptive programming?
How QTP support all types of applications (platforms)?
Can you brief the hurdles you faced during Automation testing?
How to change the priorities of the recovery scenario properties?
How to creating an output value using quicktest professional (qtp)?