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

Suppose if a functionalityis not mensioned in requirement document and but its present in application. will it be consider as a bug and viceversa?

2 Answers  


1.Write a CRITICAL test cases for calculator ? 2.What is the difference b/w FRS and SRS documents ? 3.What is Component ? 4.What is object ? 5.what is the difference b/w static and dynamic descriptive programming ?

0 Answers   HP,


How exactly you start scripting in QTP? In the interview he was not satisfied with my answer.Please post what is correct answer.

5 Answers  


What is checkpoints for quicktest professional (qtp)?

0 Answers  


hai friend's .. my question is a[0]=I a[1]=N a[2]=D LIKE IT GO'S i need output INDIA ,using simple string how will u do? can any one tell really need full..

4 Answers   Mind Tree, Tech Mahindra,






how to get the data from a winedit box in vb scripting and store it in a variable if data contains "_"(i.e data is TEST_1)

3 Answers  


how to automate standalone infopath forms using QTP? (it is not a dotnet or a web form)

1 Answers   ABC,


Find the 'String' from excel sheet and save to another sheet.But we don't know the string column number and row number?

4 Answers  


What is the use of environment variables?

1 Answers  


when you press a link it displays "the page cannot be displayed" then as a tester how you will find the problem,what type of problem must be it?

3 Answers  


What are the key points to create a framework in QTP for oracle forms?

0 Answers  


What is the present version of the VB Script we are using

1 Answers  


Categories