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
How to create Reusable and Multiple Actions?
What is Distributed testing? How does UFT support it?
What is the difference between keyword view and expert view?
What is the quicktest professional (qtp) testing process?
is it possible to add sheets to excel at runtime
How can i check items sorted or not in a weblist ? Give me the script for this...
i have asked earlier only one question how to test web application using QTp plz send me the answer quickly
How can we retrieve the Bug Ids which are open&Reopen in status through QTP scrit?Please find the script which i tried... Dim objBugFactory, objBug Dim BugId Set TDConnection = QCUtil.TDConnection Set objBug = TDConnection.BugFactory If QCUtil.IsConnected then Reporter.ReportEvent 0, "Connected", "Connected to server: " + QCUtil.TDConnection.ServerName + chr (13) +"Project: " + QCUtil.TDConnection.ProjectName + chr (13) + "Domain: " + QCUtil.TDConnection.DomainName Reporter.ReportEvent 0, "Current time on server is","==>" & TDConnection.ServerTime Else Reporter.ReportEvent 1, "Not connected", "Not connected to Quality Center" End If If mybug.Status="Open" Then BugId=mybug.DefectId MsgBox BugId End If 'OR**********************************--------------------- -----********************************** If Bug_Fields("BG_STATUS").Value ="Open" Or "Re Open"Then BugId=Bug_Fields("BG_BUG_ID").Value MsgBox BugId End If
How do you know the location Id of an object if you know its index id?
i am a begnner so am learning Error handling :tried using Recovery manager didnt work i want to be able to handle errors , e.g. if while running the test the folwoing does not show up then how can i use the If then else and goto next step in the test, as in many scenarios it does not show up Browser("The Shopping Channel -").Page("The Shopping Channel -_8").Image("easy pay").Click
On what document base Descriptive programming is written if build is not yet ready ?
Hi, I am using OutputCheckPoint for 2 webelements Bed:4 and Bath:2 Full,1 partial in my result page and I am storing the value in the data table. I dont need the string Bed:4,I would like to get only the no 4. How can I get it? Even though I highlight only 4,It is seleting the full value "bed 4". Same thing happend for second webelement Bath:2 Full,1 partial I need only the No 2. I used the following to split MyArray = Split(UIBathResult, " ", -1, 1) But it is giving the value My Array(0)=Bath:2full,1Partial I need the only the nos for further comparision.Any help? Thanks Uma
how u will evaluate the tool for test automation?
What is the framework your company is following. What is the reason. Explain why key word driven frame work is chosen.
What is action? How many types of actions are there in qtp?