I am creating a winrunner script to test HTML application, I have
struck in one area and If any one who tried the following scenario,
please try to send some sample code for me.
HTML page contains a Multiple names like serverA,serverB etc. and
each name got a checkbox attached for that. My requirement is
dynamically select one of the servername's and do the checkbox on for
the correct servername. My objective is to select the checkbox on
for that particular name to remove that. I am able to select the
name dynamically but I am not able to click the checkbox associated
with that name. Please send me the winrunner function for this.
User Richard McCrae (firstname.lastname@example.org) posted:
I have a similar problem and use a couple of different approaches. If the items are in a table, it is possible to
read through the table and then determine which box is associated with 'server X'. The second approach is to parse the
html itself. Read the html page line by line, keeping a count of the number of boxes seen to date. When you come to
the phrase which describes 'server X' you know that the box you want is a particular count into the page. (Be aware that
the phrase in the page may be significantly different from 'server X'.) Dynamically add a reference ( GUI_add(......
index count....) for the check box. Then you have it.
It's a fairly general solution that can be used for a wide variety of objects in a dynamic page.
Rick McCrae MSC MBA
Quality Center CPC
You can map the any one of the Check objects say map one object with a logical name 'ServerName'. The physical description says something like this
Here the part_value specifies the check box value.
The select and deselect of the check box can be controlled using the function
rc=button_set("ServerName",ON); where rc will be 0 if the object-ServerName is found.
Before selecting or deselecting the checkbox you need to set the part_value of the ServerName object to a specified one from the list of Servers. for this use this function
GUI_buf_set_desc_attr(gui_path, "main", "ServerName","part_value","ServerA");