Sar*_*rah 5 javascript selenium webdriver selenium-webdriver
这个的长短是我尝试使用的时候
return this.driver.findElement(By.css("div[class*='img']")).click();
Run Code Online (Sandbox Code Playgroud)
我收到一个错误 Uncaught WebDriverError: unknown error: Element is not clickable at point (525, 889). Other element would receive the click:...
我怎样才能点击然后让"其他元素"收到点击?我正在使用webdriverjs.
这背后的原因基本上是我正在测试的网站做了一些花哨的反应,以某种方式模糊了链接.基本上没有附加到图像的链接,整个图像覆盖着一个透明的盒子,链接到你的某个地方(不要问我为什么).当您"单击图像"时,实际上并未单击图像,但从用户的角度来看,它们是同一个.
当我使用webdriverIO时,我可以说
browser.moveToObject("img");
browser.leftClick();
但是我们正在远离那个.我也试过了
this.driver.findElement(By.css("div[class*='img']"));
return this.driver.actions().click().perform();
Run Code Online (Sandbox Code Playgroud)
但它似乎没有做任何事情.
关于这个错误有很多问题,但我还没有看到任何想让你点击的错误.
在寻找几小时答案,发布问题并立即找到答案的经典案例中,我找到了一个解决方法:
var mylink = this.driver.findElement(By.css("div[class*='img']"));
return this.driver.executeScript("arguments[0].click();", mylink);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1390 次 |
| 最近记录: |