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

后端 未结 7 2990
花落未央
花落未央 2021-02-20 12:40

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.selen         


        
7条回答
  •  青春惊慌失措
    2021-02-20 13:35

    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) 
    

提交回复
热议问题