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



please write a script to find the text in a application. Note: i dont know the location of that tex..

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

please write a script to find the text in a application. Note: i dont know the location of that tex..

Answer / amarendra kothuru

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

Post New Answer

More QTP Interview Questions

This is Karthic and my mail id is karthic.venkitapathi@gmail.com, please give me an idea to crack qtp 10

0 Answers  


I wnnt to learn about QTP Automation Framework,please give URL Address to get more information about AFW.

0 Answers   UHG,


Hi,Every one,my name is RAHUL,aim wondering if any one got QTP software? If yes,can u plz knock on to gchinthakindhi@gmail/yahoo.com. THANK U.

2 Answers  


How to associate shared object repository to test in qtp?

0 Answers  


how to test Web application using QTP software

4 Answers   BITS,






Did u use check points during ur work experience ?

3 Answers   FedEx,


On the website, the protocol has been changed https: to https what you will do? Tell me your approach?

0 Answers  


As u told write Libarary files in QTP. Do u use ever oject repositary 0r spy while writing scripts and for which type of testing u prepared test scripts.

1 Answers  


After geting the modules where we generate the script ie in qtp or notpad ?

1 Answers  


What is the extension for Recovery scenario?

2 Answers  


i have read that "non-reusable actions can not be called in any other test".but in 'call to copy action' copies non-reusable action in other test also..can u pls help to understand this..

0 Answers  


Ehat is the descriptive programing in QTP?

4 Answers  


Categories