SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.7k stars 8.19k forks source link

[🐛 Bug]: Selenium Webdriver is not getting connected after upgrading Selenium=4.8.2 #11757

Closed lbhavani9 closed 1 year ago

lbhavani9 commented 1 year ago

What happened?

Initially our Portal application has Standalone-chrome version 3.8.1 and selenium with versions 3.141.0 installed .The driver statement driver = webdriver.Remote(command_executor="http://chrome:4444/wd/hub",desired_capabilities=capabilites) used to connect to Selenium webdriver worked earlier as expected and the acceptance tests used to pass. All of sudden the acceptance tests are failing and we have identified that Selenium webdriver is not working as expected. Now we have changed our application to use Selenium latest version 4.8.2 , Standalone-chrome: latest . We have tried to change the driver connection statement driver = webdriver.Remote(command_executor="http://127.0.0,1:4444/wd/hub", desired_capabilities=capabilities) which is our local host and also tried with Chrome standalone IP address which docker container is pointing driver to "http://172.17.0.2:4444/wd/hub" but none of them are working.We are using python 3.9-ubuntu20.04-230331 version for our Portal application in our Dockerfile. Can anyone help us understand the issue

How can we reproduce the issue?

import os 
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.common.proxy import proxy, ProxyType
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait

def set_up():
    http_proxy = os .environment.get('http_proxy')
    https_proxy = os.environment.get('https_proxy')
    no_proxy = os.environment.get('no-proxy')
    proxy = Proxy()
    proxy.proxyType = ProxyType.Manual
    proxy.httpProxy = http_proxy
    proxy.socksProxy = http_proxy
    proxy.sslProxy = http_proxy
    proxy.noProxy = no_proxy
    capabilities = DesiredCapabilities.CHROME
    proxy.add_to_capabilities(capabilities)
    driver = webdriver.Remote(command_executor="http://127.0.0.1:44444/wd/hub", desired_capabilities=capabilities)
    wait = WebdriverWait(driver, 30)
    return driver, wait

Relevant log output

(base) 88e9fe626cdf:ECEFG-Portal QST429$ pipenv run behave --no-skipped --junit --junit-directory behave_results_dev --tags=dev tests/acceptance_tests
Feature: Portal # tests/acceptance_tests/portal.feature:1

  @dev
  Scenario: User goes to the explore page                                                            # tests/acceptance_tests/portal.feature:4
    Given a user with eid "ece_portal_test"                                                          # tests/acceptance_tests/steps/portal_steps.py:7 0.000s
    When the user goes to the "help" page in "https://ecefg-portal-dev.clouddqt.capitalone.com/help" # tests/acceptance_tests/steps/portal_steps.py:12
~/ECEFG-Portal/tests/acceptance_tests/steps/selenium_docker_container ~/ECEFG-Portal
WARN[0000] The "http_proxy" variable is not set. Defaulting to a blank string.
WARN[0000] The "https_proxy" variable is not set. Defaulting to a blank string.
WARN[0000] The "no_proxy" variable is not set. Defaulting to a blank string.
WARN[0000] The "http_proxy" variable is not set. Defaulting to a blank string.
WARN[0000] The "https_proxy" variable is not set. Defaulting to a blank string.
WARN[0000] The "no_proxy" variable is not set. Defaulting to a blank string.
WARN[0000] The "ECE_TEST_USER_USERNAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "ECE_TEST_USER_PASSWORD" variable is not set. Defaulting to a blank string.
WARN[0000] The "http_proxy" variable is not set. Defaulting to a blank string.
WARN[0000] The "https_proxy" variable is not set. Defaulting to a blank string.
WARN[0000] The "no_proxy" variable is not set. Defaulting to a blank string.
[+] Building 0.1s (9/9) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                              0.0s
 => => transferring dockerfile: 32B                                                                                                                               0.0s
 => [internal] load .dockerignore                                                                                                                                 0.0s
 => => transferring context: 2B                                                                                                                                   0.0s
 => [internal] load metadata for artifactory.cloud.capitalone.com/cof-approved-images/python:3.9-ubuntu20.04-230131                                               0.0s
 => [internal] load build context                                                                                                                                 0.0s
 => => transferring context: 52B                                                                                                                                  0.0s
 => [1/4] FROM artifactory.cloud.capitalone.com/cof-approved-images/python:3.9-ubuntu20.04-230131                                                                 0.0s
 => CACHED [2/4] RUN pip3 install 'selenium== 4.8.2'                                                                                                              0.0s
 => CACHED [3/4] COPY portal_steps_implementation.py /tests/                                                                                                      0.0s
 => CACHED [4/4] WORKDIR /tests/                                                                                                                                  0.0s
 => exporting to image                                                                                                                                            0.0s
 => => exporting layers                                                                                                                                           0.0s
 => => writing image sha256:c6d52288b2de7cc4e91ba9f126797327ea789e01437711431c5c7079f2a3abfa                                                                      0.0s
 => => naming to docker.io/library/selenium_docker_container-acceptancetest                                                                                       0.0s
[+] Running 2/2
 ⠿ Container selenium_docker_container-chrome-1          Recreated                                                                                                0.1s
 ⠿ Container selenium_docker_container-acceptancetest-1  Recreated                                                                                                0.2s
Attaching to selenium_docker_container-acceptancetest-1, selenium_docker_container-chrome-1
selenium_docker_container-chrome-1          | 20:33:44.999 INFO - Selenium build info: version: '3.8.1', revision: '6e95a6684b'
selenium_docker_container-chrome-1          | 20:33:45.000 INFO - Launching a standalone Selenium Server
selenium_docker_container-chrome-1          | 2023-03-10 20:33:45.164:INFO::main: Logging initialized @428ms to org.seleniumhq.jetty9.util.log.StdErrLog
selenium_docker_container-chrome-1          | 20:33:45.213 INFO - Using `new FirefoxOptions()` is preferred to `DesiredCapabilities.firefox()`
selenium_docker_container-chrome-1          | 20:33:45.233 INFO - Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
selenium_docker_container-chrome-1          | 20:33:45.235 INFO - Using `new EdgeOptions()` is preferred to `DesiredCapabilities.edge()`
selenium_docker_container-chrome-1          | 20:33:45.236 INFO - Driver class not found: com.opera.core.systems.OperaDriver
selenium_docker_container-chrome-1          | 20:33:45.236 INFO - Using `new OperaOptions()` is preferred to `DesiredCapabilities.operaBlink()`
selenium_docker_container-chrome-1          | 20:33:45.237 INFO - Using `new SafariOptions()` is preferred to `DesiredCapabilities.safari()`
selenium_docker_container-chrome-1          | 20:33:45.239 INFO - Driver class not found: org.openqa.selenium.phantomjs.PhantomJSDriver
selenium_docker_container-chrome-1          | 20:33:45.281 INFO - Driver provider class org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
selenium_docker_container-chrome-1          |  registration capabilities Capabilities {browserName: internet explorer, ensureCleanSession: true, platform: WINDOWS, version: } does not match the current platform LINUX
selenium_docker_container-chrome-1          | 20:33:45.282 INFO - Driver provider class org.openqa.selenium.edge.EdgeDriver registration is skipped:
selenium_docker_container-chrome-1          |  registration capabilities Capabilities {browserName: MicrosoftEdge, platform: WINDOWS, version: } does not match the current platform LINUX
selenium_docker_container-chrome-1          | 20:33:45.283 INFO - Driver provider class org.openqa.selenium.safari.SafariDriver registration is skipped:
selenium_docker_container-chrome-1          |  registration capabilities Capabilities {browserName: safari, platform: MAC, version: } does not match the current platform LINUX
selenium_docker_container-chrome-1          | 20:33:45.328 INFO - Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
selenium_docker_container-chrome-1          | 20:33:45.330 INFO - Using `new EdgeOptions()` is preferred to `DesiredCapabilities.edge()`
selenium_docker_container-chrome-1          | 20:33:45.331 INFO - Using `new FirefoxOptions()` is preferred to `DesiredCapabilities.firefox()`
selenium_docker_container-chrome-1          | 20:33:45.332 INFO - Using `new OperaOptions()` is preferred to `DesiredCapabilities.operaBlink()`
selenium_docker_container-chrome-1          | 20:33:45.332 INFO - Using `new SafariOptions()` is preferred to `DesiredCapabilities.safari()`
selenium_docker_container-chrome-1          | 20:33:45.347 INFO - Using the passthrough mode handler
selenium_docker_container-chrome-1          | 2023-03-10 20:33:45.385:INFO:osjs.Server:main: jetty-9.4.7.v20170914
selenium_docker_container-chrome-1          | 2023-03-10 20:33:45.453:WARN:osjs.SecurityHandler:main: ServletContext@o.s.j.s.ServletContextHandler@7cbd213e{/,null,STARTING} has uncovered http methods for path: /
selenium_docker_container-chrome-1          | 2023-03-10 20:33:45.460:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@7cbd213e{/,null,AVAILABLE}
selenium_docker_container-acceptancetest-1 exited with code 0
Aborting on container exit...
[+] Running 2/2
 ⠿ Container selenium_docker_container-acceptancetest-1  Stopped                                                                                                  0.0s
    When the user goes to the "help" page in "https://ecefg-portal-dev.clouddqt.capitalone.com/help" # tests/acceptance_tests/steps/portal_steps.py:12 4.936s     0.2s
    Then the user can see the page                                                                   # tests/acceptance_tests/steps/portal_steps.py:20 0.000s

  @dev
  Scenario: User goes to the login page                                                          # tests/acceptance_tests/portal.feature:17
    Given a user with eid "ece_portal_test"                                                      # tests/acceptance_tests/steps/portal_steps.py:7 0.000s
    When the user goes to the "login" page in "https://ecefg-portal-dev.clouddqt.capitalone.com" # tests/acceptance_tests/steps/portal_steps.py:12
~/ECEFG-Portal/tests/acceptance_tests/steps/selenium_docker_container ~/ECEFG-Portal
WARN[0000] The "http_proxy" variable is not set. Defaulting to a blank string.
WARN[0000] The "https_proxy" variable is not set. Defaulting to a blank string.
WARN[0000] The "no_proxy" variable is not set. Defaulting to a blank string.
WARN[0000] The "ECE_TEST_USER_USERNAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "ECE_TEST_USER_PASSWORD" variable is not set. Defaulting to a blank string.
WARN[0000] The "http_proxy" variable is not set. Defaulting to a blank string.
WARN[0000] The "https_proxy" variable is not set. Defaulting to a blank string.
WARN[0000] The "no_proxy" variable is not set. Defaulting to a blank string.
WARN[0000] The "http_proxy" variable is not set. Defaulting to a blank string.
WARN[0000] The "https_proxy" variable is not set. Defaulting to a blank string.
WARN[0000] The "no_proxy" variable is not set. Defaulting to a blank string.
[+] Building 0.1s (9/9) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                              0.0s
 => => transferring dockerfile: 32B                                                                                                                               0.0s
 => [internal] load .dockerignore                                                                                                                                 0.0s
 => => transferring context: 2B                                                                                                                                   0.0s
 => [internal] load metadata for artifactory.cloud.capitalone.com/cof-approved-images/python:3.9-ubuntu20.04-230131                                               0.0s
 => [1/4] FROM artifactory.cloud.capitalone.com/cof-approved-images/python:3.9-ubuntu20.04-230131                                                                 0.0s
 => [internal] load build context                                                                                                                                 0.0s
 => => transferring context: 52B                                                                                                                                  0.0s
 => CACHED [2/4] RUN pip3 install 'selenium== 4.8.2'                                                                                                              0.0s
 => CACHED [3/4] COPY portal_steps_implementation.py /tests/                                                                                                      0.0s
 => CACHED [4/4] WORKDIR /tests/                                                                                                                                  0.0s
 => exporting to image                                                                                                                                            0.0s
 => => exporting layers                                                                                                                                           0.0s
 => => writing image sha256:c6d52288b2de7cc4e91ba9f126797327ea789e01437711431c5c7079f2a3abfa                                                                      0.0s
 => => naming to docker.io/library/selenium_docker_container-acceptancetest                                                                                       0.0s
[+] Running 2/2
 ⠿ Container selenium_docker_container-chrome-1          Created                                                                                                  0.0s
 ⠿ Container selenium_docker_container-acceptancetest-1  Recreated                                                                                                0.1s
Attaching to selenium_docker_container-acceptancetest-1, selenium_docker_container-chrome-1
selenium_docker_container-chrome-1          | 20:33:49.674 INFO - Selenium build info: version: '3.8.1', revision: '6e95a6684b'
selenium_docker_container-chrome-1          | 20:33:49.674 INFO - Launching a standalone Selenium Server
selenium_docker_container-chrome-1          | 2023-03-10 20:33:49.773:INFO::main: Logging initialized @339ms to org.seleniumhq.jetty9.util.log.StdErrLog
selenium_docker_container-chrome-1          | 20:33:49.819 INFO - Using `new FirefoxOptions()` is preferred to `DesiredCapabilities.firefox()`
selenium_docker_container-chrome-1          | 20:33:49.835 INFO - Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
selenium_docker_container-chrome-1          | 20:33:49.838 INFO - Using `new EdgeOptions()` is preferred to `DesiredCapabilities.edge()`
selenium_docker_container-chrome-1          | 20:33:49.839 INFO - Driver class not found: com.opera.core.systems.OperaDriver
selenium_docker_container-chrome-1          | 20:33:49.839 INFO - Using `new OperaOptions()` is preferred to `DesiredCapabilities.operaBlink()`
selenium_docker_container-chrome-1          | 20:33:49.840 INFO - Using `new SafariOptions()` is preferred to `DesiredCapabilities.safari()`
selenium_docker_container-chrome-1          | 20:33:49.840 INFO - Driver class not found: org.openqa.selenium.phantomjs.PhantomJSDriver
selenium_docker_container-chrome-1          | 20:33:49.880 INFO - Driver provider class org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
selenium_docker_container-chrome-1          |  registration capabilities Capabilities {browserName: internet explorer, ensureCleanSession: true, platform: WINDOWS, version: } does not match the current platform LINUX
selenium_docker_container-chrome-1          | 20:33:49.881 INFO - Driver provider class org.openqa.selenium.edge.EdgeDriver registration is skipped:
selenium_docker_container-chrome-1          |  registration capabilities Capabilities {browserName: MicrosoftEdge, platform: WINDOWS, version: } does not match the current platform LINUX
selenium_docker_container-chrome-1          | 20:33:49.882 INFO - Driver provider class org.openqa.selenium.safari.SafariDriver registration is skipped:
selenium_docker_container-chrome-1          |  registration capabilities Capabilities {browserName: safari, platform: MAC, version: } does not match the current platform LINUX
selenium_docker_container-acceptancetest-1  | /tests/portal_steps_implementation.py:49: DeprecationWarning: desired_capabilities has been deprecated, please pass in an Options object with options kwarg
selenium_docker_container-acceptancetest-1  |   driver = webdriver.Remote(
selenium_docker_container-chrome-1          | 20:33:49.921 INFO - Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
selenium_docker_container-chrome-1          | 20:33:49.922 INFO - Using `new EdgeOptions()` is preferred to `DesiredCapabilities.edge()`
selenium_docker_container-chrome-1          | 20:33:49.922 INFO - Using `new FirefoxOptions()` is preferred to `DesiredCapabilities.firefox()`
selenium_docker_container-chrome-1          | 20:33:49.923 INFO - Using `new OperaOptions()` is preferred to `DesiredCapabilities.operaBlink()`
selenium_docker_container-chrome-1          | 20:33:49.923 INFO - Using `new SafariOptions()` is preferred to `DesiredCapabilities.safari()`
selenium_docker_container-chrome-1          | 20:33:49.933 INFO - Using the passthrough mode handler
selenium_docker_container-chrome-1          | 2023-03-10 20:33:49.964:INFO:osjs.Server:main: jetty-9.4.7.v20170914
selenium_docker_container-chrome-1          | 2023-03-10 20:33:50.018:WARN:osjs.SecurityHandler:main: ServletContext@o.s.j.s.ServletContextHandler@7cbd213e{/,null,STARTING} has uncovered http methods for path: /
selenium_docker_container-chrome-1          | 2023-03-10 20:33:50.035:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@7cbd213e{/,null,AVAILABLE}
selenium_docker_container-chrome-1          | 2023-03-10 20:33:50.088:INFO:osjs.AbstractConnector:main: Started ServerConnector@710726a3{HTTP/1.1,[http/1.1]}{0.0.0.0:4444}
selenium_docker_container-chrome-1          | 2023-03-10 20:33:50.088:INFO:osjs.Server:main: Started @654ms
selenium_docker_container-chrome-1          | 20:33:50.089 INFO - Selenium Server is up and running
selenium_docker_container-acceptancetest-1  | Traceback (most recent call last):
selenium_docker_container-acceptancetest-1  |   File "/usr/local/lib/python3.9/dist-packages/urllib3/connection.py", line 174, in _new_conn
selenium_docker_container-acceptancetest-1  |     conn = connection.create_connection(
selenium_docker_container-acceptancetest-1  |   File "/usr/local/lib/python3.9/dist-packages/urllib3/util/connection.py", line 95, in create_connection
selenium_docker_container-acceptancetest-1  | Setting up driver
selenium_docker_container-acceptancetest-1  | HTTP_PROXY is:
selenium_docker_container-acceptancetest-1  | HTTPS_PROXY is:
selenium_docker_container-acceptancetest-1  | NO_PROXY is: ,app
selenium_docker_container-acceptancetest-1  | Error loading Flask App page
selenium_docker_container-acceptancetest-1  | HTTPConnectionPool(host='172.17.0.2', port=4444): Max retries exceeded with url: /wd/hub/session (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fc1c740c850>: Failed to establish a new connection: [Errno 110] Connection timed out'))
selenium_docker_container-acceptancetest-1  |     raise err
selenium_docker_container-acceptancetest-1  |   File "/usr/local/lib/python3.9/dist-packages/urllib3/util/connection.py", line 85, in create_connection
selenium_docker_container-acceptancetest-1  |     sock.connect(sa)
selenium_docker_container-acceptancetest-1  | TimeoutError: [Errno 110] Connection timed out
selenium_docker_container-acceptancetest-1  |
selenium_docker_container-acceptancetest-1  | During handling of the above exception, another exception occurred:
selenium_docker_container-acceptancetest-1  |
selenium_docker_container-acceptancetest-1  | Traceback (most recent call last):
selenium_docker_container-acceptancetest-1  |   File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 703, in urlopen
selenium_docker_container-acceptancetest-1  |     httplib_response = self._make_request(
selenium_docker_container-acceptancetest-1  |   File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 398, in _make_request
selenium_docker_container-acceptancetest-1  |     conn.request(method, url, **httplib_request_kw)
selenium_docker_container-acceptancetest-1  |   File "/usr/local/lib/python3.9/dist-packages/urllib3/connection.py", line 239, in request
selenium_docker_container-acceptancetest-1  |     super(HTTPConnection, self).request(method, url, body=body, headers=headers)
selenium_docker_container-acceptancetest-1  |   File "/usr/lib/python3.9/http/client.py", line 1257, in request
selenium_docker_container-acceptancetest-1  |     self._send_request(method, url, body, headers, encode_chunked)
selenium_docker_container-acceptancetest-1  |   File "/usr/lib/python3.9/http/client.py", line 1303, in _send_request
selenium_docker_container-acceptancetest-1  |     self.endheaders(body, encode_chunked=encode_chunked)
selenium_docker_container-acceptancetest-1  |   File "/usr/lib/python3.9/http/client.py", line 1252, in endheaders
selenium_docker_container-acceptancetest-1  |     self._send_output(message_body, encode_chunked=encode_chunked)
selenium_docker_container-acceptancetest-1  |   File "/usr/lib/python3.9/http/client.py", line 1012, in _send_output
selenium_docker_container-acceptancetest-1  |     self.send(msg)
selenium_docker_container-acceptancetest-1  |   File "/usr/lib/python3.9/http/client.py", line 952, in send
selenium_docker_container-acceptancetest-1  |     self.connect()
selenium_docker_container-acceptancetest-1  |   File "/usr/local/lib/python3.9/dist-packages/urllib3/connection.py", line 205, in connect
selenium_docker_container-acceptancetest-1  |     conn = self._new_conn()
selenium_docker_container-acceptancetest-1  |   File "/usr/local/lib/python3.9/dist-packages/urllib3/connection.py", line 186, in _new_conn
selenium_docker_container-acceptancetest-1  |     raise NewConnectionError(
selenium_docker_container-acceptancetest-1  | urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fc1c740c850>: Failed to establish a new connection: [Errno 110] Connection timed out
selenium_docker_container-acceptancetest-1  |
selenium_docker_container-acceptancetest-1  | During handling of the above exception, another exception occurred:
selenium_docker_container-acceptancetest-1  |
selenium_docker_container-acceptancetest-1  | Traceback (most recent call last):
selenium_docker_container-acceptancetest-1  |   File "/tests/portal_steps_implementation.py", line 108, in login
selenium_docker_container-acceptancetest-1  |     driver, wait = set_up()
selenium_docker_container-acceptancetest-1  |   File "/tests/portal_steps_implementation.py", line 49, in set_up
selenium_docker_container-acceptancetest-1  |     driver = webdriver.Remote(
selenium_docker_container-acceptancetest-1  |   File "/usr/local/lib/python3.9/dist-packages/selenium/webdriver/remote/webdriver.py", line 286, in __init__
selenium_docker_container-acceptancetest-1  |     self.start_session(capabilities, browser_profile)
selenium_docker_container-acceptancetest-1  |   File "/usr/local/lib/python3.9/dist-packages/selenium/webdriver/remote/webdriver.py", line 378, in start_session
selenium_docker_container-acceptancetest-1  |     response = self.execute(Command.NEW_SESSION, parameters)
selenium_docker_container-acceptancetest-1  |   File "/usr/local/lib/python3.9/dist-packages/selenium/webdriver/remote/webdriver.py", line 438, in execute
selenium_docker_container-acceptancetest-1  |     response = self.command_executor.execute(driver_command, params)
selenium_docker_container-acceptancetest-1  |   File "/usr/local/lib/python3.9/dist-packages/selenium/webdriver/remote/remote_connection.py", line 290, in execute
selenium_docker_container-acceptancetest-1  |     return self._request(command_info[0], url, body=data)
selenium_docker_container-acceptancetest-1  |   File "/usr/local/lib/python3.9/dist-packages/selenium/webdriver/remote/remote_connection.py", line 311, in _request
selenium_docker_container-acceptancetest-1  |     response = self._conn.request(method, url, body=body, headers=headers)
selenium_docker_container-acceptancetest-1  |   File "/usr/local/lib/python3.9/dist-packages/urllib3/request.py", line 78, in request
selenium_docker_container-acceptancetest-1  |     return self.request_encode_body(
selenium_docker_container-acceptancetest-1  |   File "/usr/local/lib/python3.9/dist-packages/urllib3/request.py", line 170, in request_encode_body
selenium_docker_container-acceptancetest-1  |     return self.urlopen(method, url, **extra_kw)
selenium_docker_container-acceptancetest-1  |   File "/usr/local/lib/python3.9/dist-packages/urllib3/poolmanager.py", line 376, in urlopen
selenium_docker_container-acceptancetest-1  |     response = conn.urlopen(method, u.request_uri, **kw)
selenium_docker_container-acceptancetest-1  |   File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 815, in urlopen
selenium_docker_container-acceptancetest-1  |     return self.urlopen(
selenium_docker_container-acceptancetest-1  |   File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 815, in urlopen
selenium_docker_container-acceptancetest-1  |     return self.urlopen(
selenium_docker_container-acceptancetest-1  |   File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 815, in urlopen
selenium_docker_container-acceptancetest-1  |     return self.urlopen(
selenium_docker_container-acceptancetest-1  |   File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 787, in urlopen
selenium_docker_container-acceptancetest-1  |     retries = retries.increment(
selenium_docker_container-acceptancetest-1  |   File "/usr/local/lib/python3.9/dist-packages/urllib3/util/retry.py", line 592, in increment
selenium_docker_container-acceptancetest-1  |     raise MaxRetryError(_pool, url, error or ResponseError(cause))
selenium_docker_container-acceptancetest-1  | urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='172.17.0.2', port=4444): Max retries exceeded with url: /wd/hub/session (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fc1c740c850>: Failed to establish a new connection: [Errno 110] Connection timed out'))
selenium_docker_container-acceptancetest-1  |
selenium_docker_container-acceptancetest-1  | During handling of the above exception, another exception occurred:
selenium_docker_container-acceptancetest-1  |
selenium_docker_container-acceptancetest-1  | Traceback (most recent call last):
selenium_docker_container-acceptancetest-1  |   File "/tests/portal_steps_implementation.py", line 161, in <module>
selenium_docker_container-acceptancetest-1  |     login(url)
selenium_docker_container-acceptancetest-1  |   File "/tests/portal_steps_implementation.py", line 151, in login
selenium_docker_container-acceptancetest-1  |     raise Exception("Failed")
selenium_docker_container-acceptancetest-1  | Exception: Failed
selenium_docker_container-acceptancetest-1 exited with code 1
Aborting on container exit...
[+] Running 2/2
 ⠿ Container selenium_docker_container-acceptancetest-1  Stopped                                                                                                  0.5s
    When the user goes to the "login" page in "https://ecefg-portal-dev.clouddqt.capitalone.com" # tests/acceptance_tests/steps/portal_steps.py:12 526.779s       0.1s
    Then the user can see the page                                                               # tests/acceptance_tests/steps/portal_steps.py:20 0.004s
      Traceback (most recent call last):
        File "/Users/QST429/.local/share/virtualenvs/ECEFG-Portal-whyiJDyI/lib/python3.9/site-packages/behave/model.py", line 1329, in run
          match.run(runner.context)
        File "/Users/QST429/.local/share/virtualenvs/ECEFG-Portal-whyiJDyI/lib/python3.9/site-packages/behave/matchers.py", line 98, in run
          self.func(context, *args, **kwargs)
        File "tests/acceptance_tests/steps/portal_steps.py", line 22, in step_impl
          context.test_process.check_returncode()
        File "/usr/local/Cellar/python@3.9/3.9.15/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 460, in check_returncode
          raise CalledProcessError(self.returncode, self.args, self.stdout,
      subprocess.CalledProcessError: Command '['sh', '/Users/QST429/ECEFG-Portal/tests/acceptance_tests/steps/selenium_docker_container/run_selenium_docker_container.sh', 'login', 'https://ecefg-portal-dev.clouddqt.capitalone.com']' returned non-zero exit status 255.

Failing scenarios:
  tests/acceptance_tests/portal.feature:17  User goes to the login page

0 features passed, 1 failed, 0 skipped
1 scenario passed, 1 failed, 2 skipped
5 steps passed, 1 failed, 6 skipped, 0 undefined
Took 8m51.720s

Operating System

MAC OS version 12.6.3

Selenium version

python 3.9

What are the browser(s) and version(s) where you see this issue?

Chrome 111.0

What are the browser driver(s) and version(s) where you see this issue?

Chromedriver

Are you using Selenium Grid?

No response

github-actions[bot] commented 1 year ago

@lbhavani9, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

symonk commented 1 year ago

Your original example looks like it as resolving chrome through a compose default/bridge network as a service name- has that changed? Can you share more info for the docker network? You're example is also pointing at :44444 (one too many) but that's likely a typo as the output below port-wise is correct. Don't think its a selenium issue, looks like a docker specific configuration/issue, Please share more context around that and i'll assist you debug

lbhavani9 commented 1 year ago

Hi Symonk, Docker team confirmed that its Selenium issue and they have shared this git repo to raise concern. Actually we used to connect to Selenium Driver using driver = webdriver.Remote(command_executor="http://chrome/wd/hub", desired_capabilities=capabilities) but team has asked me to use either local IP address or server where standalone chrome:latest docker image is running. Our local address is http://127.0.0.1:4444 and the Selenium standalone Chrome is up and running on http://172.17.0.2:4444. Tried with both of them but none of them is allowing to connect to webdriver.

lbhavani9 commented 1 year ago

Our Docker-compose.yml file contains 👍

version: "3.7" networks: app-network: name: "app-network" services: chrome: image:artifactory-dockerhub.cloud.capitalone.com:443/selenium.standalone-chrome:latest environment:

lbhavani9 commented 1 year ago

Dockerfile:

FROM artifactory.cloud.capitalone.com/cof-approved-images/python3.9-ubuntu20.04-231301 LABEL Maintainer='ECE platform' ENV PIP_INDEX_URL https://artifactory.cloud.capitaone.com/artifactory/api/pypi/pypi-internalfacing/simple RUN pip3 install 'selenium== 4.8.2' COPY portal_steps_implementation.py /tests/ WORKDOR /tests/

lbhavani9 commented 1 year ago

Earlier we have used selenium 3.141.0 and Chrome artifactory dockerhub image :selenium/standalone-chrome:3.8.1. As the acceptance tests are failing login into the application we have updated the selenium version to 4.8.2 as suggested by Docker team and pulled the selenium/standalone-chrome:latest . Please let us know if you are not proceeding in correct way

diemol commented 1 year ago

Please double check that you have upgraded your tests to use Selenium 4 properly, https://www.selenium.dev/documentation/webdriver/getting_started/upgrade_to_selenium_4/.

Then make sure you are using the most recent Grid 4 containers, and note that Grid 4 has different parameters and environment variables.

I'd recommend you to ask the specific questions of your upgrade process either in our chat or in any of the links I will leave below.

github-actions[bot] commented 1 year ago

💬 Please ask questions at:

robertdeocampojr commented 1 year ago

@diemol any resolution here? I'm getting the same issue as above. using grid 3, don't have any issue but using grid 4. it throws error: Max retries exceeded with url: /wd/hub/session

diemol commented 1 year ago

Not sure what your context is. Please use the links above to ask questions or join the chat.

github-actions[bot] commented 11 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.