链选择器在webdriver.io中无法正常工作

时间:2018-05-23 18:22:47

标签: selenium-webdriver cucumber webdriver-io

我喜欢下面的dom,我能够得到第一个元素

enter image description here

这就是我想要获得第二和第三个元素但是变为空

enter image description here

这是我的黄瓜步骤定义中的实际代码。

When('I click on an option', async function() {
const items = '.entry';
await browser.waitForExist(items);
await browser.click('.entry:nth-child(2)');
});

0 个答案:

没有答案