javascript error: Failed to execute 'elementsFromPoint' on 'Document': The provided double value is non-finite

后端 未结 2 1957
一整个雨季
一整个雨季 2020-11-27 08:23

I recently updated my chrome version to latest i.e. 79.0.3945.130 (Official Build) (64-bit) and downloaded compatible chromedriver from here

I\'ve start

相关标签:
2条回答
  • 2020-11-27 09:12

    In my case i was using new Actions(driver).moveToElement(element).perform(); in Command Listener before each command so it move the focus on element which being executed.

    This line causing the error mentioned in question. After commenting this its working fine.

    0 讨论(0)
  • 2020-11-27 09:27

    This error message...

    Javascript error: Failed to execute 'elementsFromPoint' on 'Document': The provided double value is non-finite
    

    ...implies that the WebDriver instance was unable to find the element for one or the other reasons:

    • The element haven't loaded properly when you tried to interact with it.
    • Element is within an <iframe> / <frame>
    • The style attribute of the element contains display: none;
    • Element is within an shadow DOM

    The relevant HTML would have been helpful to analyze the issue in a better way. However, you need to take care of a couple of things as follows:

    • The id attribute of the <select> tag is attribute178 which is clearly dynamic. So you need to construct a dynamic Locator Strategy

    • As the id attribute of the <select> tag is dynamic, you need to induce WebDriverWait for the element_to_be_clickable() and you can use either of the following Locator Strategies:

    • cssSelector:

      Select s = new Select(new WebDriverWait(getDriver(), 20).until(ExpectedConditions.elementToBeClickable(By.cssSelector("select.super-attribute-select[id^='attribute']"))));
      s.selectByIndex(1);
      
    • xpath:

      Select s = new Select(new WebDriverWait(getDriver(), 20).until(ExpectedConditions.elementToBeClickable(By.xpath("//select[@class='super-attribute-select' and starts-with(@id, 'attribute')]"))));
      s.selectByIndex(1);
      
    0 讨论(0)
提交回复
热议问题