drop down lists (data-driven testing)

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
kobe
Posts: 1
Joined: Mon Aug 26, 2013 11:48 am

drop down lists (data-driven testing)

Post by kobe » Mon Aug 26, 2013 12:20 pm

I face some troubles running tests on web applications where drop down lists are used. Each time I run a test, I add a new value into drop down list. After that I open this list and select the recently added value to continue. Test fails on this step. Using track button in Ranorex Spy I can easely get this value:
/dom[@domain='webaddress.com']/body/ul[1]/?/?/a[@innertext='ADDEDVALUE']

But since this item in each test will be different, each time it will have a different position on the list (ul[3] for example) and different name 'ADDEDVALUE2'.

What I have tried. I have turned off image checking, I used variable to identify added value and deleted index in ul[1], so it is only 'ul' now:

/body/ul/a[@innertext=$varkeyword]
/body/ul[1]/?/?/a[@innertext='$varkeyword']
/body/ul/?/?/a[@innertext='$varkeyword']

So, my question is: how can I select a value from a drop down list when both name of added value and it's position on the list changes every time I run a new test?

I use Ranorex only a few days and do not have rich programming experience, so, please have it in mind answering!

Thanks in advance!

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: drop down lists (data-driven testing)

Post by Support Team » Thu Aug 29, 2013 3:32 pm

Hi,

Using variables is the right way, since you can set the variable to the value of the newly added item.
Do you have already tried to use the value of the added item as value for your variable (varkeyword) as well?

Are you using the repository or are you using one of the Find methods in order to get the added list item?
Please also send us additional information about your tests.
Are you using the Recorder and do you know that you can copy the repository variables to your recordings in order to set them to a specific value?

For more information about how to use variables, please see: Lesson 3: Data-Driven Testing and Recorder Variables.

Regards,
Markus
.
Image