0

I am trying to find out the JavaScript equivalent of the selectByIndex() method that is provided in the Java Webdriver API. I am trying to do what is addressed in this question (but using the WebdriverJS framework):

I have looked at the WebdriverJS source, but haven't found anything.

Is there a way to select an element based off of its index position using Selenium's Javascript Webdriver?

Community
  • 1
  • 1
Erik Owen
  • 83
  • 1
  • 5

1 Answers1

0

Could you do something like this?

var index = {your in index}
driver.findElements(By.css('option'))
    .then(function(options){
        return options[index].click();
    });
bm_i
  • 568
  • 5
  • 9