please write a script to find the text in a application.
Note: i dont know the location of that text where it is
located. just like negative testing.
Answers were Sorted based on User's Feedback
Answer / gangadhar reddy
a=Dialog( ).GetTextLocation("OK",x1,y1,x2,y2)
msgbox a
if a=True then
msgbox "text found"
else
msgbox "text does not found "
end if
'OK=text string to be found on app
'x1,y1,x2,y2 are the coordinates
try this once you get the result
| Is This Answer Correct ? | 0 Yes | 1 No |
In general, In the web application, The text can be
recogized by QTP as WebElement. If you on what page it
should be displayed, Then it is easier to verify that text.
For Example
Text = "Welcome to Yahoo"
Result = Browser("name:=Yahoo").Page
("title:=Yahoo").WebElement("inntertext:=& Text).Exist(0)
If Result = True Then
Reporter.ReportEvent MicPass, "Text found", "Passed"
Else
Reporter.ReportEvent MicFail, "Text not found", "Failed"
End If
If you want to verify ur application, Pass the exact Object
Property values as per the Hirarchy
| Is This Answer Correct ? | 0 Yes | 3 No |
what are the difference ways of parameterising?
What is All object and Local object in Object Repositary? Explain me please.
what is the use of automation objective model?where is used? plz tell me
difference Between Call Run action and copy of action?
How comfortable are you in VB scripting?
Tell me one scenario, the complex functionality you have automated in your project?
How to customize qtp?
How can I replace all the text from the QTP script with some other text.
what skills needed to be good test automation?
How to change the scripts from Per-Action object repository to shared object repository
During test run,How will you copy/paste from/to clipboard?
what is the main use of reviews