SeleniumHQ / docker-selenium

Provides a simple way to run Selenium Grid with Chrome, Firefox, and Edge using Docker, making it easier to perform browser automation
http://www.selenium.dev/docker-selenium/
Other
7.92k stars 2.51k forks source link

Ruby driver error after upgrading to 3.141.59-palladium #919

Closed leshik closed 5 years ago

leshik commented 5 years ago

💥 Regression Report

After upgrading to the latest 3.141.59-palladium our tests are failing with

NoMethodError:
       undefined method `log' for #<Selenium::WebDriver::Remote::W3C::Bridge:0x0000555dc6fd2838>

The code in questions is page.driver.browser.manage.logs.get(:browser) (we're using Capybara).

Last working version

Worked up to version:

3.141.59-oxygen

Stopped working in version:

3.141.59-palladium

Any suggestions are appreciated. Is it related to the chromedriver? Should I file the issue there?

individual-it commented 5 years ago

we are running tests with nightwatch and since the update getting


 Error while running .isElementDisplayed() protocol action: TypeError [ERR_UNESCAPED_CHARACTERS]: Error while trying to create HTTP request for "/wd/hub/session/fa970f0d7a9230b30b045d3661db484d/element/[object Object]/displayed": Request path contains unescaped characters
    at new ClientRequest (_http_client.js:115:13)
    at Object.request (http.js:42:10)
    at HttpRequest.createHttpRequest (/home/artur/www/owncloud-phoenix/node_modules/nightwatch/lib/http/request.js:112:55)
    at HttpRequest.send (/home/artur/www/owncloud-phoenix/node_modules/nightwatch/lib/http/request.js:191:29)
    at Promise (/home/artur/www/owncloud-phoenix/node_modules/nightwatch/lib/transport/transport.js:189:15)
    at new Promise (<anonymous>)
    at Selenium2Protocol.sendProtocolAction (/home/artur/www/owncloud-phoenix/node_modules/nightwatch/lib/transport/transport.js:187:12)
    at Selenium2Protocol.runProtocolAction (/home/artur/www/owncloud-phoenix/node_modules/nightwatch/lib/transport/jsonwire.js:61:17)
    at Object.isElementDisplayed (/home/artur/www/owncloud-phoenix/node_modules/nightwatch/lib/transport/actions.js:54:10)
    at Selenium2Protocol.executeProtocolAction (/home/artur/www/owncloud-phoenix/node_modules/nightwatch/lib/transport/transport.js:235:48)
    at WaitForElementVisible.executeProtocolAction (/home/artur/www/owncloud-phoenix/node_modules/nightwatch/lib/element/command.js:201:27)
    at WaitForElementVisible.protocolAction (/home/artur/www/owncloud-phoenix/node_modules/nightwatch/lib/api/element-commands/_waitForDisplayed.js:5:17)
    at WaitForElementVisible.elementFound (/home/artur/www/owncloud-phoenix/node_modules/nightwatch/lib/element/command.js:168:17)
    at action (/home/artur/www/owncloud-phoenix/node_modules/nightwatch/lib/api/element-commands/_waitForDisplayed.js:40:36)
    at PeriodicPromise.perform (/home/artur/www/owncloud-phoenix/node_modules/nightwatch/lib/util/periodic-promise.js:79:29)
    at Timeout.setTimeout (/home/artur/www/owncloud-phoenix/node_modules/nightwatch/lib/util/periodic-promise.js:117:12)
phil-davis commented 5 years ago

See issue #922

It also fails with PHP Behat-Mink-Selenium stack, e.g. https://drone.owncloud.com/owncloud/core/18073/681

  Scenario: simple user login                                                                 # /drone/src/tests/acceptance/features/webUILogin/login.feature:12
    Given these users have been created with default attributes but not initialized:          # FeatureContext::theseUsersHaveBeenCreated()
      | username |
      | user1    |
    When user "user1" logs in using the webUI                                                 # WebUILoginContext::theUserLogsInUsingTheWebUI()
      Exception: Page\LoginPage::waitTillPageIsLoaded timeout waiting for page to load in /drone/src/tests/acceptance/features/lib/LoginPage.php:103
      Stack trace:
      #0 /tmp/ProxyManagerGeneratedProxy__PM__PageLoginPageGenerated6312256563dff9947346b9792a817253.php(44): Page\LoginPage->waitTillPageIsLoaded(Object(Behat\Mink\Session), 10000)
      #1 /drone/src/tests/acceptance/features/bootstrap/WebUIGeneralContext.php(226): ProxyManagerGeneratedProxy\__PM__\Page\LoginPage\Generated6312256563dff9947346b9792a817253->waitTillPageIsLoaded(Object(Behat\Mink\Session))
      #2 /drone/src/tests/acceptance/features/bootstrap/WebUILoginContext.php(152): WebUIGeneralContext->loginAs('user1', '1234')

The Apache server sees the request for the login page, so a browser is starting, being sent a URL and does try to go there. But somehow the connection through selenium to chromedriver and the browser seems to just not "see" the web page (elements) that come back.

Reverting back to selenium/standalone-chrome-debug:3.141.59-oxygen PR https://github.com/owncloud/core/pull/35442 makes UI testing great again.

twalpole commented 5 years ago

The initial issue reported here is because Chrome 75 defaults to W3C mode which doesn't support log access. Either specify w3c: false as an option in your driver registration or remove the code that accesses logs from your tests. The other two reports are different issues.

diemol commented 5 years ago

Thanks for triaging @twalpole!

phil-davis commented 5 years ago

@diemol for the other posts in this thread do we need to open a separate issue? https://github.com/SeleniumHQ/docker-selenium/issues/919#issuecomment-499341314 https://github.com/SeleniumHQ/docker-selenium/issues/919#issuecomment-499336330

diemol commented 5 years ago

Yes @phil-davis, with the complete template filled out please.

phil-davis commented 5 years ago

Issue #922 raised. When we understand how to fix/workaround that, then I expect we will also solve @individual-it post https://github.com/SeleniumHQ/docker-selenium/issues/919#issuecomment-499336330