Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

How can SilkTest click on a HtmlPushButton within a dynamic popup window?

How can SilkTest click on a HtmlPushButton within a dynamic popup window?

If the page is totally dynamic, recording declarations will not work. How can I check for instances of HtmlPushButton and if any exist click on them?

This simple script gets all the children and loops through each individual child and finds out what each class these objects are instances of. This example states that if any of these are of an HtmlPushButton class, to click on it.. There is no error checking in this example so if clicking the button results in displaying a new page an error will be raised.

[-] testcase childrenTest () appstate none
    [ ] 
    [ ] 
    [ ] BrowserPage.SetActive()
    [ ] list of window lwPopupDecs
    [ ] lwPopupDecs = BrowserPage.GetChildren () // retrieve all children of the popup window
    [ ] window wPopupDecsComponent
    [ ] DATACLASS Class
    [ ] 
    [-] for each wPopupDecsComponent in lwPopupDecs // parse through list of children
        [ ] Class = (wPopupDecsComponent.GetClass ()) // take each and determine their class
        [-] if Class == HtmlPushButton // if it equals to a HtmlPushButton class
            [ ] wPopupDecsComponent.Click () // click on this

Old KB# 22206

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 19:29
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.