Q. What are test objects?
Test objects are objects created and maintained by QTP in its object repository. Each test object has a name and a set of properties to uniquely identify the actual object in the application.

Q. how does QTP identifies the objects during the script run?
During script run QTP searches for a run-time object that has the similar description of the test object in the object repository.

Q. How can i check the properties of an object in an application without using checkpoints? For Example how will you check whether a button is enabled?
Answer: GetROProperty method is used to retrieve the properties of the object in an application.It is very useful method and can be used to retrieve almost any of the property that can be seen while spying the object with object spy. For Example‘To get whether button is enabled or not.

Val = Browser("QA Friends").Page("QA Friends"). WebButton("Login"). GetROProperty("disabled")

‘To get whether a checkbox is on or off.

Val =Browser("QA Friends").Page("QA Friends").WebCheckBox("Test").GetROProperty("Value")

Q. How can I modify the properties values of test objects in Object Repository during runtime?
A. You can use SetTOProperty method of test object.Object(description).SetTOProperty Property, Value - The values of test object properties are used to identify the objects. Sometimes the properties of the object in the application change dynamically. For example text of a link in a webpage is the username used to login to that page.Text property is used by test object to identify the link. So in order to identify the actual object we can manipulate the value of “text” property of link using SetTOProperty.

Q. How do you synchronize your scripts in QTP?
A. For waiting until navigation of web page completes we can use Sync method. For waiting until an object appears we can use Exist method. For waiting until a property of object changes we can use WaitProperty method. You can set browser navigation timeout in: Click Test > Settings menu Select web tab in Test Settings window. Enter the timeout in Browser Navigation Timeout text box. You can set global object synchronization timeout in: Click Test > Settings menu Select Run tab in Test Settings window. Enter the timeout in Object Synchronization Timeout text box.

0 comments