Clicking on some coordinates is not working in Docker
🐛 Bug Report
We render some banner on the screen, navigate mouse to its center and perform click(). What we've noticed is:
- It's working using ChromeDriver installed on the host machine (OS X);
- With the same code and on the same page
click()is not working on Docker-based Chrome.
That said, after code execution we have 2 open tabs in case of local ChromeDriver (which is correct behavior of click), and 1 open tab in case of Docker-based Chrome, which means click was not performed.
To Reproduce
Let's say we have ChromeDriver installed at the /users/shared/chromedriver location, and we run the container using next command:
docker run -dt -p 23756:4444 --name selenium-chrome selenium/standalone-chrome:3.141.59-dubnium
Then we can run the code, uncommenting local chromedriver instantiation when necessary:
import time
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
# driver = webdriver.Chrome('/users/shared/chromedriver')
driver = webdriver.Remote(
command_executor='http://127.0.0.1:23756/wd/hub',
desired_capabilities=DesiredCapabilities.CHROME)
driver.get('https://px.adhigh.net/rtb/creative_preview?s=direct&c=137393');
time.sleep(10) # Let the user actually see something!
print("clicking!")
div_box = driver.find_element_by_xpath('//*[contains(@id,\'__GetI_div\')]')
ActionChains(driver).move_to_element(div_box).click().perform()
time.sleep(15) # Let the user actually see something!
tabs = len(driver.window_handles)
print(tabs)
driver.quit()
Expected behavior
We expect that both in Docker-based Chrome and local ChromeDriver cases the output will be 2 open tabs.
Test script reproducing this issue (when applicable)
In OS X, I just using downloaded ChromeDriver executable localy (from here - https://chromedriver.storage.googleapis.com/index.html?path=2.45/)
Environment
OS: OS X Docker-Selenium image version: 3.141.59-dubnium Host machine ChromeDriver version: 2.45.615355 (d5698f682d8b2742017df6c81e0bd8e6a3063189) Docker image ID: 2bddb17bbcf8 Docker version: 18.03.1-ce, build 9ee9f40
For now, it seems that this issue is not related to any problem with Chrome or Docker. Closing.
Sorry we didn't reply earlier, what were your findings?