我想在textarea中输入文本,但由于id是动态的,因此无法找到该元素,如果我使用class,则element是可见的。这是元素的Snippet Code,这是UI。我是在脚本上写的
let textArea = Selector('.block-card list-group-item text-card col-xs-12').find('textarea')
await t
.typeText(textArea, 'Hai...')
我有错误:
The specified selector does not match any element in the DOM tree.
> | Selector('.block-card list-group-item text-card col-xs-12')
| .find('textarea')
我也使用
let textArea = Selector('.hwt-container').find('textarea').withAttribute('class','text-card-text')
还是一样。
尝试使用hasClass方法代替withAttribute。