我试图从<div class=".react-grid-HeaderCell-sortable">Jamie</div>
<div class=".react-grid-HeaderCell-sortable">Hutber</div>
<div class=".react-grid-HeaderCell-sortable">Stackoverflow</div>
元素中取出文本然后将这些值存储在一个数组中,以便稍后我可以比较测试中的值。
['jamie', 'hutber', 'stackoverflow']
最后,我想要一个等于的数组:
module.exports = {
tags: ['someTest'],
'Test login': function (browser) {
browser
.elements('css selector', '.react-grid-Header .react-grid-HeaderCell-sortable', (items) => {
items.value.forEach(item => {
item //{...}
item.ELEMENT //123123123.12 (an id of some sort)?
console.info(driver.findElement(By.id(item.ELEMENT))); //driver is undefined
});
})
}
}
我的代码
{{1}}