Robot Framework using Python 3.6.8 on Ubuntu 18.04.2 LTS docker container
I still have not been able to get this to work with the ChromeDriver direct, however, I was able to get this to work using selenium grid:
https://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.59.jar
I started a Hub (in a container) and then a node directly on the container running the test and it worked. I'm still working on building the container that runs the node (it's not working as a separate container though...I must need to add some configurations). Below is the robot framework test suite using a remote chrome driver:
*** Settings ***Documentation... This is a simple robot test to open a browser and check the title of a given website.Library CollectionsLibrary DateTimeLibrary DialogsLibrary OperatingSystemLibrary SeleniumLibraryLibrary StringLibrary RequestsLibrarySuite Setup Setup Environment and Open BrowserSuite Teardown Close All Browsers*** Variables ***${BROWSER} HeadlessChrome${SITE_URL} https://www.google.com*** Test Cases ***Title Test Title Should Be Google*** Keywords ***Open Chrome Browser To URL [Documentation] Open Chrome browser and navigate to URL with browser options set [Tags] open_chrome_browser ${chromeOptions} Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver Call Method ${chromeOptions} add_argument --headless ${ws}= Set Variable window-size=1920, 1080 Call Method ${chromeOptions} add_argument ${ws} Call Method ${chromeOptions} add_argument --disable-extensions Call Method ${chromeOptions} add_argument --disable-gpu Call Method ${chromeOptions} add_argument --disable-dev-shm-usage Call Method ${chromeOptions} add_argument --ignore-certificate-errors ${remoteOptions}= Call Method ${chromeOptions} to_capabilities Create Webdriver Remote command_executor=http://<IP ADDR OF HUB>:4444/wd/hub desired_capabilities=${remoteOptions} Go To ${SITE_URL} Maximize Browser WindowBrowser timeout and speed [Documentation] ... Set browser timeout and speed Set Selenium Timeout 30s Set Selenium Speed 0sSetup Environment and Open Browser [Documentation] ... This keyword will establish the environment variables and open a browser [Tags] simple_test Open Chrome Browser To URL Browser timeout and speed
Now to figure out how to run the node in a container...
After a bit more research, I just used the public Selenium Grid 3 hub and nodes to solve my issue.
https://github.com/SeleniumHQ/docker-selenium/tree/selenium-3/Hub