Forum Discussion

Louis's avatar
Louis
Contributor
14 years ago

data driving on screen action items

I wish to data drive the items for an on screen action but can't figure it out.

I use keyword testing and have the following to achieve

a web page has 96 checkboxes i wish to check if each individual box is ticked and if not tick them, I was hoping to use data driving where an " if then" command  is driven by a list of mapped aliases e.g checkbox0, checkbox1 etc. The if then command checks the state of the checkbox then the indented "on screen action" command ticks the box if needs be. The item within the "on screen action" command item  was to be driven by the aliase for each of the 96 checkboxes.

My altenative is 96 individual if then commands for each checkbox on screen which is going to be laboureous.

1 Reply

  • Hi,


    There is no need to create a data-driven test. If you already have aliases for your check boxes (checkbox0, checkbox1, …, checkbox68), you can use a sample keyword test to check whether all the check boxes are checked. In the attachments, there is an image of such a test. 


    The test uses the While loop to iterate through the check boxes. In the loop, you first specify the check box's alias name by using the constant "Aliases.checkbox" and the keyword test variable i. Then you obtain a reference to the check box with the specified name (by using the Eval function) and check whether the check box is selected (by using the checked property). If the checked property is False, the test enables the check box by using the ClickChecked method.