You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remote WebDriver fails to execute any command through a Selenium 4.0.0 Standalone Server in Chrome if any other (non IP address) hostname than “localhost” is used for connecting to the Selenium Server.
Having URLs with other names than “localhost” for the host part is a very common scenario in a containerized environment. Using IP addresses ususally is not an option in environments as dynamic as e.g. a Kuberneter cluster.
This issue can be reproduced by running basic remote WebDriver commands against a selenium/standalone-chrome:4.0.0 Docker container.
Given you have Docker installed and you have unpacked the attached selenium.zip file.
Open a shell.
Run docker-compose up -d.
Run docker-compose run client python /selenium4.py.
Traceback (most recent call last):
File "/selenium4.py", line 7, in <module>
driver.get("http://www.google.com")
File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 333, in get
self.execute(Command.GET, {'url': url})
File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 208, in check_response
raise exception_class(value)
selenium.common.exceptions.WebDriverException: Message: Host header or origin header is specified and is not localhost.
For demonstrating that this is not an issue with selenium/standalone-chrome:3.141.59, run: docker-compose run client python /selenium3.py.
selenium4.py does complete successfully when being run from the host machine (given Python is installed) with http://localhost:4444, resp. as the Selenium Server URL.
Environment
Browser: Chrome
Browser Version: The one included with selenium/standalone-chrome:4.0.0
Selenium Grid version: 4.0.0
The text was updated successfully, but these errors were encountered:
I am the Selenium Assistant Bot 🤖, I triage issues in this repository. If I can't do it, I label it to help maintainers identify issues that need triaging.
I am an Open Source project 🙌, post bugs or ideas here!
❗️ It seems this issue is not using any of the supported templates
💡 Supported issue types are (they start with):
🐛 Bug Report (bugs found in a recent release)
🚀 Feature Proposal (a useful feature you would like to propose)
💥 Regression Report (a supported feature is not working anymore)
Issue templates help this project to stay in shape, please use them and fill them out completely. By doing that you are helping the project because the community and maintainers can provide prompt feedback, and potentially solve the issue.
If you are asking a question, a better way to address this is:
🐛 Bug Report
Remote WebDriver fails to execute any command through a Selenium 4.0.0 Standalone Server in Chrome if any other (non IP address) hostname than “localhost” is used for connecting to the Selenium Server.
Having URLs with other names than “localhost” for the host part is a very common scenario in a containerized environment. Using IP addresses ususally is not an option in environments as dynamic as e.g. a Kuberneter cluster.
The root cause may be related to this Chromium issue.
Detailed steps to reproduce the behavior:
This issue can be reproduced by running basic remote WebDriver commands against a selenium/standalone-chrome:4.0.0 Docker container.
Given you have Docker installed and you have unpacked the attached
selenium.zip file.
docker-compose up -d
.docker-compose run client python /selenium4.py
.For demonstrating that this is not an issue with selenium/standalone-chrome:3.141.59, run:
docker-compose run client python /selenium3.py
.The commands in selenium3.py and selenium4.py are as simple as:
Expected behavior
selenium4.py should complete successfully.
selenium4.py does complete successfully when being run from the host machine (given Python is installed) with
http://localhost:4444
, resp. as the Selenium Server URL.Environment
Browser: Chrome
Browser Version: The one included with selenium/standalone-chrome:4.0.0
Selenium Grid version: 4.0.0
The text was updated successfully, but these errors were encountered: