picking a value from a dynamic drop down list created by a class "selectboxit"

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

picking a value from a dynamic drop down list created by a class "selectboxit"

Edward Moore
Hi.

I am trying to pick a value from a drop down list created by a class called "selectboxit"  http://gregfranko.com/jquery.selectBoxIt.js/ and whilst I could specify the location in the list I want to pick with an xpath containing a position, I cannot reliably say what value will be in that list at that position for any given departure / arrival / port combination.

The site under test is www.poferries.com/en/calais-dover and its the departure times I need to select. I have a team of manual testers and I am trying to build them a framework that will keep them at arms length from the code.

These ferries sail at different times on each day, and from each port. I don't really want to have a bunch of code to identify which sailing time is in which position for which port, inbound and outbound.

having opened the page and set the dates this line of code opens the departure time selector drop down in question:

  driver.findElement(By.xpath("//*[@id=\"singleJourneyTimeComboBoxSelectBoxItContainer\"]")).click();

My attempts to select a value from this list in such a way that I can pass a value to the driver and have it click the right option have all failed miserably :)

The exact same question has, or seems to have been answered here : 


with what appears to be the same drop down object however I have been unable to build an xpath that can locate and click on a time I specify. I think I am attempting to identify the element with the list expanded and visible and the ul / li elements rendered on the page.

My full code is on GitHub at https://github.com/irtuk/selenium I have included all the required jars as well as geckodriver so it should check out and run with minimal changes.

Any suggestions most welcome.

Thanks

Ed

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/e85a716e-7ef2-4d20-90d3-a7950fcdb8ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.