I\'m trying to run chrome headless with my robot framework tests suites. I managed to do it independtly with python using selenium as follows:
options = webd
Try out these two keywords:
Open Chrome
[Arguments] ${url} ${lang}
${chrome_options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
Call Method ${chrome_options} add_argument headless
Call Method ${chrome_options} add_argument disable-gpu
Create Webdriver Chrome chrome_options=${chrome_options}
Go To ${url}
Open Remote Chrome
[Arguments] ${url} ${remote_url} ${lang}
${chrome_options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
Call Method ${chrome_options} add_argument headless
Call Method ${chrome_options} add_argument disable-gpu
Open Browser ${url} Chrome remote_url=${remote_url} desired_capabilities=${chrome_options.to_capabilities()}
First one will launch a local chrome, while the second one is to launch a remote chrome. If you need to be able to handle the remote vs. local into a single keyword, you can create a wrapper around these two with a boolean argument that will determine which keyword to call.