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.84k stars 2.51k forks source link

[🐛 Bug]: Unable to interact with browser popups for new images beyond 3.141.59-20210929 #2074

Open ramgitai opened 8 months ago

ramgitai commented 8 months ago

What happened?

We are using docker swarm to setup our hub and node configuration. Our automation framework is based on WebdriverIO V6 and everything was working fine till docker-selenium hub/node image version : 3.141.59-20210929. Any later image after this version is causing our code unable to interact with popups, all other browser interactions are working fine. The selenium code is timing out waiting for element to be displayed. The same code works fine on the local laptop with the latest Chrome browser versions. We have updated the chrome driver as needed for example for image node-chrome:4.15.0-20231102 we upgraded chrome driver to 119. Please help identify this issue

Environment: CentOS Linux release 7.8.2003 node-chrome:4.15.0-20231102 (or any image after 3.141.59-20210929) hub::4.15.0-20231102 (or any image after 3.141.59-20210929)

Command used to start Selenium Grid with Docker (or Kubernetes)

docker stack deploy -c docker-compose_v3.141.59-20210929.yml Selenium - Working code
docker stack deploy -c docker_compose_4.yml Selenium - Not working (Selenium image version in this yaml file is 4.15.0-20231102)

Relevant log output

Error stack 

Error: element ("//div[@id="markCompleteDialog"]//button[text()="Member View"]") still not displayed after 10000ms
                    at C:\Work\iex\ghix-tools\test\GHIX_UI_Automation_Tests\node_modules\webdriverio\build\commands\browser\waitUntil.js:66:23
                    at Element.elementErrorHandlerCallbackFn (C:\Work\iex\ghix-tools\test\GHIX_UI_Automation_Tests\node_modules\webdriverio\build\middlewares.js:23:32)
                    at Element.runCommandWithHooks (C:\Work\iex\ghix-tools\test\GHIX_UI_Automation_Tests\node_modules\@wdio\sync\build\wrapCommand.js:105:25)
                    at Element.runCommandWithHooks (C:\Work\iex\ghix-tools\test\GHIX_UI_Automation_Tests\node_modules\@wdio\sync\build\wrapCommand.js:100:24)
                    at Element.wrapCommandFn (C:\Work\iex\ghix-tools\test\GHIX_UI_Automation_Tests\node_modules\@wdio\sync\build\wrapCommand.js:67:44)
                    at Element.elementErrorHandlerCallback (C:\Work\iex\ghix-tools\test\GHIX_UI_Automation_Tests\node_modules\webdriverio\build\middlewares.js:44:12)
                    at Browser.waitForElementToDisplay (C:\Work\iex\ghix-tools\test\GHIX_UI_Automation_Tests\tests\base\Browser.js:232:17)
                    at ViewMember.clickOnViewMemberAccount (C:\Work\iex\ghix-tools\test\GHIX_UI_Automation_Tests\tests\pagemodels\CAP\MemberManagement\ViewMemberPage.js:69:17)
                    at World.<anonymous> (C:\Work\iex\ghix-tools\test\GHIX_UI_Automation_Tests\tests\stepDefs\CAP\MemberManagement\ViewMember.steps.js:17:16)
                    at World.executeSync (C:\Work\iex\ghix-tools\test\GHIX_UI_Automation_Tests\node_modules\@wdio\sync\build\index.js:38:22)
                    at C:\Work\iex\ghix-tools\test\GHIX_UI_Automation_Tests\node_modules\@wdio\sync\build\index.js:69:68

Operating System

CentOS Linux release 7.8.2003

Docker Selenium version (image tag)

4.15.0-20231102

Selenium Grid chart version (chart version)

No response

github-actions[bot] commented 8 months ago

@ramgitai, 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!

diemol commented 8 months ago

That is tricky for us to troubleshoot because since Grid 4.9, the old protocol is not supported at all, only W3C WebDriver. So I am not sure what WDIO v6 uses. You could either share the code you are using to get those errors, or ask in the WDIO support chat.

ramgitai commented 8 months ago

@diemol I missed to add one critical point. When we run the tests individually the tests pass on the Docker Selenium hub/node setup as well. However, when we run these tests in parallel two or more tests we see this issue with popup interaction. Also, if we have only one chrome browser per container and run two or more tests in parallel the tests pass. So, I am not sure if it is related to protocol or something else. We tried this on both WebdriverIO V6 and V7. I am attaching the docker swarm yaml files, please let us know if we are missing any config.

Here is the yaml file we are using:

To execute this docker-compose yml file use docker-compose -f docker-compose-v3.yml up

Add the -d flag at the end for detached execution

To stop the execution, hit Ctrl+C, and then docker-compose -f docker-compose-v3.yml down

version: "3.8" services: chrome: image: selenium/node-chrome:4.15.0-20231102 depends_on:

diemol commented 8 months ago

Seems like an issue with the tests because Grid treats each session independently.

How can I reproduce that behavior?