- OS: python 3.11.1
This docker container contains:
- docker build . -t {tagname}
- docker pull moleszek/robotframework:latest
- docker run -it --rm -v {localFolderPath}:/robot moleszek/robotframework:latest -m robot {robotTest}.robot
Inside the keywords section add:
*** Keywords ***
Chrome Headless
${chrome_options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
Call Method ${chrome_options} add_argument --disable-extensions
Call Method ${chrome_options} add_argument --headless
Call Method ${chrome_options} add_argument --disable-gpu
Call Method ${chrome_options} add_argument --no-sandbox
Create Webdriver Chrome chrome_options=${chrome_options}
This keyword allows to run chrome in headless mode.
See example.