无法单击表单内部的按钮(其所说的带有定位器的元素是不可见的)
我想在框架中选择一个按钮。 但是有些未选择。在下面的代码中尝试切换到帧并单击typescript中的元素。
await browser.switchTo().frame(element(by.xpath("//div[@id='main-container']")).getWebElement());
await this.element(by.css('.uploadDiv #uploadP')).click(); --> Did not work
let frame3 = element(by.xpath("//div[@id='main-container']")).getWebElement();
browser.switchTo().frame(frame3);
await this.element(by.css('.uploadDiv #uploadP')).click(); --> Did not work
I wanted to select a button in a Frame ..
But some how its not selecting .. Tried below code to switch to frame and click on element in Protractor with TypeScript ..
await browser.switchTo().frame(element(by.xpath("//div[@id='main-container']")).getWebElement());
await this.element(by.css('.uploadDiv #uploadP')).click(); --> Did not work
let frame3 = element(by.xpath("//div[@id='main-container']")).getWebElement();
browser.switchTo().frame(frame3);
await this.element(by.css('.uploadDiv #uploadP')).click(); --> Did not work
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以打印元素矩形或获取InnerHTML以查看该元素是否隐藏。
一种更简单的方法是利用某些录音机工具,例如Vistual Studio代码ClickNium扩展名来记录元素,然后进行验证,它将突出显示目标元素位置
you can print the element rectangle or get innerhtml to see whether the element is hidden.
an easier way is to leverage some recorder tools such as vistual studio code clicknium extension to recorde the element and then do validation, it will highlight the target element position