Skip to content

solairen/docker_robotframework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About:

  • OS: python 3.11.1

This docker container contains:

How to build or download:

Build docker images from Dockerfile:

  • docker build . -t {tagname}

Download from Docker repository:

  • docker pull moleszek/robotframework:latest

How to run:

To run robot framework script using robotframework Docker image directly:

  • docker run -it --rm -v {localFolderPath}:/robot moleszek/robotframework:latest -m robot {robotTest}.robot

Add headless chrome to keywords

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.