我正在尝试单击具有以下代码的元素:
test('no existed user try', async() => {
await page.click($x('//*[contains (text(), "people")]'))
})
返回错误$x is not a function
如何通过单击正确使用xpath?
答案 0 :(得分:0)
test('no existed user try', async() => {
const elements = await page.$x('//*[contains (text(), "people")]');
await elements[0].click();
});