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)
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.
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.
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.
I had same issue and observation was , multiple elements by same xpath. Finding different unique xpath resolved it
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With