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

I am struggling to understand QTP more from descriptive programming point of view. Is it easy to learn good QTP in South india by good faculty than north india? I found a great lack of institution in here. can you suggest me better instituion. I am holding two years of experience in same company, is there possibility in south india for me?

1 Answers  


what are the environment variables,how do you use them. give an example.

3 Answers   Polaris,


can u Give Procedure to Handle Pop Window & write Code for that

2 Answers   CTS,


where exactly we can't do the automation testing. give some examples

2 Answers   Virtusa, Wipro,


Can we write winrunner language i.e TSL in QTP tool?

0 Answers  






In project module it contains 3-ok buttons with same properties who qtp identify its objects while runing ??

5 Answers   HCL,


What is the syntax to call one script from another? And what can be the syntax to call one “action” in another?

0 Answers  


What is the syntax to call one action in another?

0 Answers  


how to retrieve the column headers in database using vbscript statement in QTP

1 Answers  


Hi experts. I want to create a framework for the Flight Reservation sample application.Can anybody tell me the files and the contents , and how to create them.Thanks

2 Answers   IBM,


what testing activities u may want to automate?

2 Answers  


WHAT IS OBJECT REPROSITORY?

4 Answers   BirlaSoft,


Categories