Change Firefox configuration and set up proxy

764 views
Skip to first unread message

mates

unread,
Aug 5, 2011, 10:03:33 AM8/5/11
to Selenium Users
Hi, i am struggling with setting up proxy for Firefox. Is it even
possible to set Firefox configuration this way?

My code is similar to this...

from selenium import webdriver
from selenium.webdriver import FirefoxProfile

profile = FirefoxProfile()
profile.set_preference('network.proxy.http', 'proxy.somewhere')
profile.set_preference('network.proxy.http_port', '3128')
profile.set_preference('network.proxy.type', '1')

capa = {'browser_name': 'firefox'}

driver = webdriver.Remote(desired_capabilities=capa,
command_executor='http://127.0.0.1:4444/wb/hub',
browser_profile=profile )

Mark Collin

unread,
Aug 5, 2011, 10:15:37 AM8/5/11
to seleniu...@googlegroups.com
This should work:

Proxy proxy = new Proxy();
proxy.setHttpProxy(<proxyAddress>);
DesiredCapabilities ap = DesiredCapabilities.firefox();
cap.setCapability(CapabilityType.PROXY, proxy);
WebDriver driver = new FirefoxDriver(cap);

capa = {'browser_name': 'firefox'}

--
You received this message because you are subscribed to the Google Groups
"Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to
selenium-user...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/selenium-users?hl=en.


--
This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.

If you have received this email in error please notify postm...@ardescosolutions.com

mates

unread,
Aug 5, 2011, 10:50:17 AM8/5/11
to Selenium Users
Thanks for your response.

Unfortunately i am limited to use Python. New Firefox window is
opened, but configuration looks untouched.
> For more options, visit this group athttp://groups.google.com/group/selenium-users?hl=en.
>
> --
> This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.
>
> If you have received this email in error please notify postmas...@ardescosolutions.com

Mark Collin

unread,
Aug 5, 2011, 10:55:13 AM8/5/11
to seleniu...@googlegroups.com
One for a python person then I'm afraid :(

Thanks for your response.

If you have received this email in error please notify postm...@ardescosolutions.com

Jayakumar C

unread,
Aug 6, 2011, 12:02:02 PM8/6/11
to seleniu...@googlegroups.com
@mates,

Use profile.update_preferences() , after the series of profile.set_preference('...', '...') statements.


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.




--
Jayakumar
Reply all
Reply to author
Forward
0 new messages