在我的一项测试中,我将鼠标移动到特定位置,然后clickMouseButton()被调用。此操作是更改显示的数据(对数据进行分页)。但是,单击后,当我尝试获取表格列中的文本以验证数据是否更改时,数据更改回最初显示的内容我的测试失败了。我的测试代码是:
return Remote
.moveMouseTo(JE.Buttons.Scrolling(), 5, 100)
.clickMouseButton()
.end(Infinity)
.sleep(500)
.findByXpath('//*[@id="vwNJEAll_grid_header_tbody"]/tr[2]/td[2]/div')
.getVisibleText()
.then(function (result) {
expect(result).not.to.equal(firstSeenJENumber);
});
后面的代码JE.Buttons.Scrolling()是:
return Remote
.setFindTimeout(5000)
.findByXpath('//*[@id="vwNJEAll_grid_table_container"]/div[2]/div');
在我看来,Leadfoot 中的定位器在首次加载时确实与页面上的内容绑定。是这样吗,我应该如何去做我需要发生的事情?我对此没有其他解释,但希望你能做到。