Xpath

Apart from Technical Topics, increasingly i find myself wanting to write about other topics that interests me - Entreprenuership and Business, Leadership, Africa, Service Industry (e.g Hotels, Restaurant). My writings would always represent my opinions and it might change from time to time.

Selenium: Xpath locator can not be used as Option Locator

In my new job been doing a lot of selenium and i needed to scroll through the list of options in a select element and click on a particular options. I have initially used the browser.DoubleClick browser.DoubleClick(“xpath=//select/option[child::text()=‘Option_Label’]“);) But then this didnt work because selenium doesn’t have the functionality to scroll down the select element in other to make my desired option visible. Looking through the selenium api, i have used another method, which take in two parameters, the select locator and the option locator.