drop down lists (data-driven testing)
Posted: 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!
/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!