首页 > Linux操作系统 > Linux操作系统 > Working with Dynamic Content[faq]

Working with Dynamic Content[faq]

原创 Linux操作系统 作者:ipqiaojj 时间:2009-03-17 15:28:45 0 删除 编辑

Working with Dynamic Content

  • How can I create and run components on objects that change dynamically from viewing to viewing?
  • 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.

  • How can I check that a child window exists (or does not exist)?
  • 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.


    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")


    For more information on the Exist property and ChildObjects method, see the HP QuickTest Professional Object Model Reference.

  • How does QuickTest record on dynamically generated URLs and Web pages?
  • 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.

  • How does QuickTest handle tabs in browsers?
  • 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博客 ” ,链接:,如需转载,请注明出处,否则将追究法律责任。



  • 博文量
  • 访问量