webdriver io - Webdriverio -- Elements doesn't work -


i trying use elements array of elements, doesn't work here.

any 1 can me that? lots.

here code:

<select name="test" id="select"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> 

now trying option elements:

client.url('www.somesite.com')   .elements('#select>option').then(function(res){        console.log(res.length);     }) 

but got 'undefined' result 'res.length' .

if use gettext can correct result:

 client.url('www.somesite.com')   .gettext('#select>option').then(function(res){        console.log(res.length);     }) 

you need access value property.

console.log(res.value.length); 

Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -