Suppose my html is like so
<select class="list">
<option val="00"></option>
<option val="01">One</option>
</select>
This js test file is able to run, but I am trying to get the number of children elements in the select list.
var assert = require('assert'),
test = require('selenium-webdriver/testing'),
webdriver = require('selenium-webdriver');
var demoFile = '/path/to/my/test.html';
driver.get(demoFile);
//Setup driver
var driver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).build();
//Get the child elements of select list, which are the options
var ele = driver.findElement(webdriver.By.className('list'))
.findElements(webdriver.By.tagName('option')));
//size is undefined
ele.size();
However, I am get the error below when I try to get the option count.
TypeError: Object [object Object] has no method 'size'