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

How to Start recording using QTP?

1 Answers  


Our company is having a windows client server application developed in vb.net. so there is a treeview and i am not in a position to record the click events in QTP. so kindly help. Vivek

0 Answers  


Can I compare two DataBases using QTP ?

1 Answers  


Explain how you can delete excel file in qtp?

0 Answers  


Suppose U change the script whether it affect the object properties of the object in the object repository

4 Answers   IBM,






Hi Friends,I hav Just finished QTP course.Can any body suggest me which is the best place to go and post resume(Ban,Chennai,Pune,Mumbai,NCR,Kolkata).I mean how r calls in these cities,the best one?

3 Answers  


what is the frame work your using in automation testing

2 Answers  


Can any one give me some basic VB script used in QTP ?As i am new in QTP.Give sample VB script used in QTP? PLZ

3 Answers  


What is iteration?

1 Answers  


I am Facing Issues with learing datepicker 1)when i first learn datepicker as current system date . 2)if i wanna runtime datepicker value it gives error

0 Answers  


what is web application and client server application.is there any difference ?

1 Answers   Wells Fargo,


In qtp what type of data tables are used , name and list out them

1 Answers   Polaris,


Categories