I would like to instantiate a chromedriver instance in my Robot suite setup but I need to install an extension upon browser startup. I'm able to easily do this at the Python level by simply adding chromeoptions to my webdriver instatiation, but I need to do this at the Robot level. I found that there IS a keyword "Create Webdriver" that allows you to pass arguments into your webdriver instantiation. However, I still cannot get an extension to install at startup. I am using Options from selenium.webdriver.chrome.options and the function add_extension. Can anyone please help me with this?
Some_Setup
${options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver.chrome.options
${options.add_extension}= Set_Variable path/to/extension
Create WebDriver Chrome chrome_options=${options}
If there is a way to pass in my extension via desired capabilities, how would I format that in a dictionary? It seems like desired_capabilties has a chromeOptions field with an args:[] and extensions:[] fields avaialable but I don't know how to pass my extension to it.
Using Options from selenium.webdriver.chrome.options, add the extension in Python using
return the Options object, save it into the ${chrome_options} variable, and then...
Note the the robot test suite must import the python lib that defines some "get_options" function as above.