Setting a Socks Proxy in Firefox Webdriver with Robot Framework

Here are the Robot Framework keywords needed nowadays to setup a socks5 proxy (e.g ssh -ND 9050

*** Settings ***
Documentation     Open a Web Page using a socks 5 proxy (demo)
Library           Selenium2Library

*** Test Cases ***
Create Webdriver and Open Page
    ${profile}=   Evaluate   sys.modules['selenium.webdriver'].FirefoxProfile()
    Call Method   ${profile}   set_preference   network.proxy.socks
    Call Method   ${profile}   set_preference   network.proxy.socks_port
    Call Method   ${profile}   set_preference   network.proxy.socks_remote_dns
    Call Method   ${profile}   set_preference   network.proxy.type   ${1}
    Create WebDriver   Firefox   firefox_profile=${profile}
    Go To
Permalink. Category: Linux. Tags: Open-Source Testing Automation planet-inuits.
First published on Thu 30 March 2017.