0
我想要使用元素来获取元素数组,但它不起作用。Webdriverio - 元素不起作用
任何人都可以帮助我呢?十分感谢。
这里是我的代码:
<select name="test" id="select">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
现在我试图让所有的选项元素:
client.url('www.somesite.com')
.elements('#select>option').then(function(res){
console.log(res.length);
})
但我得到 '未定义' 对于 'res.length' 的结果。
如果我使用gettext然后我就可以得到正确的结果:
client.url('www.somesite.com')
.getText('#select>option').then(function(res){
console.log(res.length);
})
非常感谢。有用! – andreas