Sometimes the content of objects in an application changes due to dynamic content. You can create dynamic descriptions of these objects so that QuickTest will recognize them when it runs the component using regular expressions, the Description object, repository parameters, or SetTOProperty steps.
Sometimes a link in one window creates another window.
You can use the Exist property to check whether or not a window exists. For example:
If Window("Main").ActiveX("Slider").Exist Then
. . .
You can also use the ChildObjects method to retrieve all child objects (or the subset of child objects that match a certain description) on the Desktop or within any other parent object.
Example:
Set Desc = Description.Create
oDesc("Class Name").Value = "Window"
ser coll = Desktop.ChildObjects(oDesc)
For i = 0 to coll.count -1
msgbox coll(i).GetROProperty("text")
Next
For more information on the Exist property and ChildObjects method, see the HP QuickTest Professional Object Model Reference.
QuickTest actually clicks links as they are displayed on the page. Therefore, QuickTest records how to find a particular object, such as a link on the page, rather than the object itself. For example, if the link to a dynamically generated URL is an image, then QuickTest records the "IMG" HTML tag, and the name of the image. This enables QuickTest to find this image in the future and click on it.
QuickTest provides several methods that you can use with the Browser test object to manage tabs in your Web browser.
OpenNewTab opens a new tab in the current Web browser.
IsSiblingTab indicates whether a specified tab is a sibling of the current tab object in the same browser window.
Close closes the current tab if more than one tab exists, and closes the browser window if the browser contains only one tab.
CloseAllTabs closes all tabs in a browser and closes the browser window.
For more information on these Browser-related methods, see the Web section of the HP QuickTest Professional Object Model Reference.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/16792402/viewspace-571203/ ,如需转载,请注明出处,否则将追究法律责任。