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 do I define a common winclass, for those windows which have the same child controls but a parent control which varies?

How do I define a common winclass, for those windows which have the same child controls but a parent control which varies?

In the instances where you have a common set of child controls but the parent winclass can vary, it can be favorable to define a common winclass in which the said child controls can be grouped. This can make code easier to maintain, as well as read. For example:

[-] winclass CommonWinclass:Anywin
[ ] //define that the CommonParent can be a SwfDialogBox or a SwfChildWin
[-] multitag "[SwfChildWin]"
[ ] "[SwfDialogBox]"
[ ]
[-] SwfTextField EnterText
[ ] tag "Enter some text"
[-] SwfPushButton OK
[ ] tag "OK"

In the above 4Test code we have defined a common winclass for SwfChildWin and SwfDialogBox controls that contain the children, SwfTextField and SwfPushButton with the specified tag information. Therefore within your declarations, where ever there is an instance of a SwfChildWin or a SwfDialogBox with the specified child controls; this can be replaced with an instance of the CommonWinclass, for example the following:

[-] window SwfMainWin myMainWin
[ ] tag "SomeApplication"
[ ]
[-] SwfChildWin myChildWin
[ ] tag "SomeChildWin"
[ ]
[-] SwfTextField EnterText
[ ] tag "Enter some text"
[-] SwfPushButton OK
[ ] tag "OK"

Would simply become:

[-] window SwfMainWin myMainWin
[ ] tag "SomeApplication"
[ ]
[-] CommonWinclass myCommonWinclass
[ ] tag "SomeChildWin"


Old KB# 23616

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:37
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.