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
hi in real time who will execute the qtp test scripts? my faculty said, in a companty automation testers are written the test scripts and manual testers are execute the test scripts...IS IT RIGHT OR NOT?
How do I get the QTP scripts result in xml format by using vb script function?
How the exception handling can be done using quicktest professional (qtp)?
How is the Bitmap checkpoint different from Image checkpoint?
Hoe can we do retesting using functions please give the code for it using login page
What are the different types of recording modes in qtp? Which will be used when?
How to do the scripting. Is there any inbuilt functions in qtp as in qtp-s. What's the difference between them? How to handle script issues?
How many ways we can parameterize data in quicktest professional?
1. What is the difference between Keyword and function in the keyword driven framework? 2. How do you associate Keywords to the script ?
What are the benefits of qtp?
Does QTP record on Objects created on XWindows Environment?
hi i am working with vbwindow on qtp.first i am openning qtp whenever open qtp my application not open that time generated error like "Runtime error 0" and fatal error:automation error how to solve this problem pls tell me
How can you identify the browser and its information using the qtp script?
you are recording on "WINDOW 1", say it has a link if you click on that, that leads you to "WINDOW 2". If you do any manipulations on "WINDOW 2" that are automatically updated in to "WINDOW 1". But "WINDOW 1" is currently invisible. But the updations in "WINDOW 1" must also be recorded as a script in QTP. The best Example is if you update your resume in JOB STREET portal it actually happens in other window, but the previous window is automatically updated. Now does QTP help you in this types of situations? Any body can answer this question. please..... Siva
Why do we use "Text checkpoint" If we can make use of it in "standard checkpoint" ?