| || |
User M Richens (firstname.lastname@example.org) posted:
I have a WinRunner problem with dealing with loops.
Sorry if it seems a little long.
I have a semi-automatic script to complete a set of web based forms with
test data but requires the selected item in a list box to be checked.
It runs until it reaches the particular list and then I use a pause to
allow the tester to select an item.
I then use
edit_get_info( "listobject name", "value", variablename );
to capture the visible detail in the list to later save to a text file
This works for both Netscape and IE (list_get_info() in NS always
returns the first item)
sometimes there can be about 50 items in the list so
To fully automate I use a
} while ( loopcount < total items in loop)
I use the list_get_info( "listobject name", "count", totalitems )
to count the loop if the totalitems is 0
list_get_item( "listobject name", loopcount, itemname);
to get the item name for later use
The problem arises when I try to set the item to complete the form
I tried to use a
list_select_item( "listobject name", itemname );
BUT in a test environment "itemname" is not always unique ( can't change
this for a lot of reasons) and it chooses the first occurrence
I know that
list_select_item( "listobject name", "#11");
will select the 12th item in the list
but I cannot work out how to used the number in the loopcounter variable
to select for example
list_select_item( "listobject name", loopcount)
as it does not work as loopcount "#loopcount".
I would appreciate advice on this as the documentation is a little
loose on this.
Re: numeric variable
you can concatenate the loop counter and the pound sign (#). For example:
itemNumber = "#" & loopCounter
Re: numeric variable
User Max Richens (email@example.com) posted:
-----BEGIN PGP SIGNED MESSAGE-----
In their erudite way in message
I must admit I wouldn't have thought of combining them into a variable
like that. It seems more logical to just use the variable.
I will try it.
Thanks a lot.
Max Richens firstname.lastname@example.org
Hashing.. Drinking for runners. Running for drinkers.
An apology:-- "I'm sorry but I like it."
On-On Cheshire H3 URL http://www.richens.demon.co.uk/hash/hashmain.htm
-----BEGIN PGP SIGNATURE-----
Version: PGPsdk version 1.7.1
-----END PGP SIGNATURE-----