I"m facing a problem when using standalone-chrome in docker with RemoteWebdriver.
docker run -d -p 4444:4444 --name standalone-chrome -p 7900:7900 --shm-size="2g" -e SE_OPTS="--log-level FINE" -e SE_NODE_MAX_SESSIONS=10 -eSE_NODE_OVERRIDE_MAX_SESSIONS=true selenium/standalone-chrome:4.1.2
The following code works fine
ChromeOptions chromeOptions = new ChromeOptions();
WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/"), chromeOptions);
driver.get("http://www.example.com");
System.out.println(driver.getPageSource());
However when I add an Augmenter it starts breaking.
ChromeOptions chromeOptions = new ChromeOptions();
WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/"), chromeOptions);
final WebDriver augmentedDriver = new Augmenter().augment(driver);
augmentedDriver.get("http://www.example.com");
The request times out because it cannot connect when creating the augmented driver.
Create session returns the docker internal URLs.
Example:
During augmenting the webdriver the AndHasCdp functionality tries to use this address which results in the hang.
Is there a way to configure the docker container so that it returns the external visible IP address (
http://localhost:4444 in this case) instead of the internal IP4 address of the container?
Seems like it was introduced in Selenium 4
Is Augmenter still in Beta as the class annotation suggests?
Thanks,
Peter