Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

selenium.JavascriptException: javascript error: Failed to execute 'elementFromPoint' on 'Document': The provided double value is non-finite

using chrome 78 and chromedriver78 When i click an audio file or try to stop an audio using selenium tests i am getting this error.

Error:

org.openqa.selenium.JavascriptException: javascript error: Failed to execute 'elementsFromPoint' on 'Document': The provided double value is non-finite.

Note it happens only with remote webdriver and its not consistent.

Error stack trace:

When the audio player of the "item_1" element is stopped in "[data-rcfid='checkbox_7']"

org.openqa.selenium.JavascriptException: javascript error: Failed to execute 'elementsFromPoint' on 'Document': The provided double value is non-finite.
  (Session info: chrome=78.0.3904.70)
Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:26:55.152Z'
System info: host: 'ip-10-0-10-137', ip: '10.0.10.137', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-71-generic', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities {acceptInsecureCerts: true, browserName: chrome, browserVersion: 78.0.3904.70, chrome: {chromedriverVersion: 78.0.3904.70 (edb9c9f3de024..., userDataDir: C:\Windows\proxy\scoped_dir...}, goog:chromeOptions: {debuggerAddress: localhost:1674}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: accept, webdriver.remote.sessionid: eb7d4195af3426c181317a16028...}
Session ID: eb7d4195af3426c181317a160286b15e0125b619
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
    at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
    at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545)
    at org.openqa.selenium.remote.RemoteWebDriver.perform(RemoteWebDriver.java:611)
    at org.openqa.selenium.interactions.Actions$BuiltAction.perform(Actions.java:638)
    at webDriver.Driver.click(Driver.java:147)
    at pageObjects.ActivityPageObject.clickAudioInlineStopIn(ActivityPageObject.java:205)
    at stepDefinition.Activity.theAudioPlayerOfTheElementIsStoppedIn(Activity.java:61)
    at ✽.When the audio player of the "item_1" element is stopped in "[data-rcfid='checkbox_7']"(/opt/atlassian/bamboo-home/xml-data/build-dir/16744451/RCF1-RMIT-BROW3/rcf-automation-tests/src/test/resources/featureFiles/interactions/markedInteractions/CheckBox.feature:433)
like image 446
Tabassum Avatar asked Nov 22 '19 15:11

Tabassum


People also ask

Can selenium detect Javascript errors?

We can capture Javascript error in Selenium. This type of error appears at the Console Tab on opening the Developer tools in the browser. This can occur due to some functional issue in the page or due to extra logs which may cause performance issues.

What is Javascript error in selenium?

The JavaScript error is a WebDriver error that occurs when a script the supplied by the user fails to execute. The underlying cause of the execution error is often supplied in the error message, along with a stacktrace provided by the JavaScript engine in the browser.

Does selenium load Javascript?

Selenium webdriver can execute Javascript. After loading a page, you can execute any javascript you want. A webdriver must be installed for selenium to work. All it takes to execute Javascript is calling the method execute_script(js) where js is your javascript code.


2 Answers

I had same issue and observation was , multiple elements by same xpath. Finding different unique xpath resolved it

like image 68
Hietsh Kumar Avatar answered Sep 23 '22 22:09

Hietsh Kumar


I have faced the same issue and was able to resolve it by simply scrolling the window down to the element I am targeting. Seems like the element wasn't showing in the viewport and that's why it wasn't visible to selenium.

Try to add the following lines before finding and clicking the element:

driver.execute_script("window.scrollTo(0, window.scrollY + 100)")
driver.implicitly_wait(3) 
like image 37
Rola Avatar answered Sep 24 '22 22:09

Rola