Possible issue with Chromedriver 78, Selenium can not find web element of PDF opened in Chrome

后端 未结 9 1113
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-17 11:02

Until my google Chrome wasn\'t updated to version 78 my code worked fine. I also updated the chromedriver to version 78.0.3904.70. So I am not able anymore to find WebElemen

相关标签:
9条回答
  • 2020-12-17 11:22

    I confirmed yesterday that this issue appears to manifest itself only when an element is contained in an iframe. In those cases, the iframe is located fine. However, attempting to locate a web element using the driver or web driver wait objects will result in a NoSuchElement or TimeoutException respectively.

    I provided the chromedriver team a verbose chrome driver log and they are working on it.

    UPDATE: From chromedriver issue 3223

    The logs show that the final executionContextCreated for the frame doesn't complete until after the FindElement returns null. Starting in version 77, ChromeDriver stopped waiting for all frames to load before continuing navigation. Unfortunately, that change prevented a wait for the current frame to load. 3164 will all a wait for the current frame to load; this should prevent FindElement from searching until after the frame has Stopped loading and the executionContext is created.

    Basically, this bug was introduced in v.77. Many of us just noticed this problem because we upgraded from v.76 to .v78. Word is that they are targeting a fix for .v80 (not v. 79). As a workaround, I am using Thread.sleep between the time I switch to the iframe and when I attempt to locate the component. This workaround works fine. In fact, you can verify this on your own by simply running your application in DEBUG mode. When you pause execution (by using a breakpoint), you'll notice that your original code (without the sleep) works fine.

    0 讨论(0)
  • 2020-12-17 11:22

    For example: You can try using this keywords!.

    1. implicit_wait=10
    2. Sleep  10
    
    0 讨论(0)
  • 2020-12-17 11:32

    We have faced a similar issue with Chrome 78.0.3904.7, Chromedriver 77/78, Python Selenium 3.141.0.

    In our automated Python Selenium tests, we've seen multiple failures where it appears that clicks on elements have not occurred. Even stranger, it appears that the element has become active (as if it were about to be clicked) but the the actual click event never occurred. As a result, page switches etc do not occur resulting in various downstream failures.

    By a process of trail and error, we found that using the standard .click() function is now not reliable:

    webdriver_element.click()
    

    But using Action Chains does appears to be reliable:

    ActionChains(context.browser).click(webdriver_element).perform()
    

    It's not clear why this is the case. The failures began as soon as we upgraded to Chrome 78.0.3904.7. We're using Chromedriver 77.0.3865.90 but the same tests pass reliably on Chrome 77.x versions therefore it appears something is wrong or has changed in Chrome 78.

    0 讨论(0)
提交回复
热议问题