0
votes

I am testing a Website using selenium IDE and this site uses something called wickets that changes the element id of elements in some random fashion. There is a drop-down list having some options but selenium is not recording anything about drop-down list. I tried doing it manually by Giving Target some to track the it by value

Command             |Target                    |Value
select              |//div[@id="duration3"]    |level=4 night (s) 

Can I Solve it by value or option?

following is the snippet: <select id="duration3" name="facets:durations:duration" wicket:id="duration"> <option value=""></option> <option value="1">1 night(s)</option> <option value="2">2 night(s)</option> <option value="3">3 night(s)</option> <option value="4">4 night(s)</option> <option value="5">5 night(s)</option> <option value="6">6 night(s)</option> <option value="7">7 night(s)</option> <option value="8">8 night(s)</option> <option value="9" selected="selected">9 night(s)</option> <option value="10">10 night(s)</option> <option value="11">11 night(s)</option> <option value="12">12 night(s)</option> <option value="13">13 night(s)</option> <option value="14">14 night(s)</option> <option value="15">15 night(s)</option> <option value="16">16 night(s)</option> <option value="17">17 night(s)</option> <option value="18">18 night(s)</option> <option value="19">19 night(s)</option> <option value="20">20 night(s)</option> <option value="21">21 night(s)</option> </select> how to track that particular element(eg. option 4).

2
what language are you using for selenium? - Rajesh
as he states - Selenium IDE - ddavison

2 Answers

0
votes

As I am ignorant of the site you are trying to test, I'll attempt to elaborate what's happening.

This is very common in websites, where the site is dynamic and the ID's get either randomly generated, or changed. If this happens, you can use the power of CSS selectors to select what you want.

in your case, the Target field would be

css=div[id^='duration']

This would look for a div that has the ID that starts with duration. Ergo, if that 3 in there changes, then it would have no effect.

0
votes

As answered in your other question, If you only want to track an element you can always use "FireBug" at least to inspect the element.