How can I get all options from drop down using selenium with node.js
below is my code:
var dropdown = driver.findElement({xpath: \'//*[@name=\"dropdo
driver.findElement({xpath: '//*[@name="dropdownnamewithoptions"]'}).then(function(webElement) {
webElement.findElements(By.tagName('option')).then(function(optionArray){
if(optionArray.length > 1){
optionArray[0].getAttribute('value').then(function(optionValue) {
});
}
});
}, function(err) {
});