Robot Framework SeleniumLibrary: Set Firefox Proxy Options
Pass a FirefoxOptions object with a manual WebDriver proxy capability to SeleniumLibrary's Open Browser keyword.
SeleniumLibrary's Open Browser keyword accepts a Selenium options object. Put the manual proxy capability on that object before the Firefox session is created:
*** Settings ***
Library SeleniumLibrary
Test Teardown Close All Browsers
*** Test Cases ***
Open Through Office Proxy
&{route}= Create Dictionary
... proxyType=manual
... httpProxy=proxy.example:8080
... sslProxy=proxy.example:8080
${options}= Evaluate selenium.webdriver.FirefoxOptions() modules=selenium.webdriver
Call Method ${options} set_capability proxy ${route}
Open Browser https://www.example.com/ firefox options=${options}
The capability uses separate HTTP and HTTPS destination fields. Their host:port values can name the same HTTP proxy when it supports both ordinary forwarding and the needed HTTPS tunnels. For the public page shown, take a compatible HTTP address from the HTTP proxy list if the test permits public intermediaries and needs no proxy account.
The options argument applies to the browser created by this keyword. Keep it with the test's browser setup so the session starts with the route it needs.
The example uses Robot's built-in dictionary, evaluation and method-call keywords together with Selenium's FirefoxOptions API. Replace the illustrative endpoint and destination. If a suite already has browser options, add the proxy capability to that existing object before passing it to Open Browser.