最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

Selenium“元素单击在点(52,346)不可单击。其他元素将使用“ nodejs

IT培训 admin 1浏览 0评论

Selenium“元素单击在点(52,346)不可单击。其他元素将使用“ nodejs

解决了单击等待的问题之后,我遇到了这个问题:

UnhandledPromiseRejectionWarning: "ElementClickInterceptedError: element click intercepted-bar-item icon-transfer">...</button> is not clickable at point (52, 346). Other element would receive the click: <div class="ut-".

我们如何“隐式”单击并忽略这种消息?

等待点击的代码如下:

  await driver.wait(until.elementLocated(By.xpath("//button[text()='Transfers']")),15000);
  let btn= driver.findElement(By.xpath("//button[text()='Transfers']"));
  await driver.wait(until.elementIsEnabled(btn,15000));
  await driver.findElement(By.xpath("//button[text()='Transfers']")).click();

code inspect screenshot

回答如下:

使用下面的抛出错误的行代码/元素

var elm = element(by.id("myid"));
browser.executeScript("arguments[0].click();", elm.getWebElement());

Selenium的javascript执行者将使用javascript单击元素

内部使用硒的量角器

Selenium“元素单击在点(52,346)不可单击。其他元素将使用“ nodejs

解决了单击等待的问题之后,我遇到了这个问题:

UnhandledPromiseRejectionWarning: "ElementClickInterceptedError: element click intercepted-bar-item icon-transfer">...</button> is not clickable at point (52, 346). Other element would receive the click: <div class="ut-".

我们如何“隐式”单击并忽略这种消息?

等待点击的代码如下:

  await driver.wait(until.elementLocated(By.xpath("//button[text()='Transfers']")),15000);
  let btn= driver.findElement(By.xpath("//button[text()='Transfers']"));
  await driver.wait(until.elementIsEnabled(btn,15000));
  await driver.findElement(By.xpath("//button[text()='Transfers']")).click();

code inspect screenshot

回答如下:

使用下面的抛出错误的行代码/元素

var elm = element(by.id("myid"));
browser.executeScript("arguments[0].click();", elm.getWebElement());

Selenium的javascript执行者将使用javascript单击元素

内部使用硒的量角器

发布评论

评论列表 (0)

  1. 暂无评论