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

What is a Data Member and how is it declared in 4Test?

What is a Data Member and how is it declared in 4Test?

A Data Member is a variable defined in either a class or a window declaration.

The value of a data member can be an expression, but it is important to keep in mind that data members are resolved (assigned values) during compilation. If the expression for the data member includes variables that will change at run-time, then you must make that data member into a property.

Data Members can be used in data-driven tests where you perform the same test against many objects.

Data added to a window declaration can be used later when testing the object, usually for verification, for example:

  • Default values for check boxes and text fields
  • Initial control focus for dialogs
  • Tab order for dialogs
  • Initial state for pushbuttons
  • Data used to populate text fields, lists or tables

To declare a Data Member

  1. Declare a variable data type within an object or class definition
  2. Specify a name for your new variable (data member)
  3. You can at this point assign a value but it is not necessary.

    Below is an example of data member declared in a window/object declaration;

To use the Data Member in a script

[-] testcase VerifyNumOfChildren () appstate none 
[ ]
[ ] INTEGER iActualNum = ListCount (Support.GetChildren())
[ ] Verify (iActualNum, Support.iNumOfChildren )

Note that you can now refer to the new Data Member directly from the script - Support.iNumOfChildren

 

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