I'm performing automated testing with Selenium and I need to test access to a particular site with different proxy's. I get the list of proxy's through a website and implement the configuration as follows:
PROXY = address
proxy = Proxy({
'proxyType': ProxyType.MANUAL,
'httpProxy': PROXY,
'ftpProxy': PROXY,
'sslProxy': PROXY,
'socksProxy': PROXY,
'noProxy': ''
})
profile = webdriver.FirefoxProfile()
profile.set_preference('general.useragent.override', random.choice(uas))
driver = webdriver.Firefox(firefox_profile=profile,proxy=proxy)
driver.set_page_load_timeout(10)
driver.get('http://www.whatsmyip.org/')
But when you open the site, the proxy setting does not work. I tried it another way too:
webdriver.DesiredCapabilities.FIREFOX["proxy"]={
'proxyType':"MANUAL",
'httpProxy': PROXY,
'ftpProxy': PROXY,
'sslProxy': PROXY,
'socksProxy': PROXY,
'noProxy': ''
}
profile = webdriver.FirefoxProfile()
profile.set_preference('general.useragent.override', random.choice(uas))
driver = webdriver.Firefox(firefox_profile=profile)
driver.set_page_load_timeout(10)
driver.get('www.whatsmyip.org/')
But with this method you get the error:
ftpProxy is not a string: ["94.63.39.88:8080","45.77.119.127:8118"...
I would like someone to help me with regards to fixing this error.