-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mozilla ignores proxy configuration #9479
Comments
Here I attache a file with the python code: |
I think this has been fixed with the latest code. Please can you retry with the selenium 4 beta release. You can install it with |
Thanks Automated Tester for your help. |
FYI it would be best if you wouldn't create a new Firefox profile via Selenium but pass the preferences and the proxy settings via capabilities: https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities Sadly |
@AlfGod Were you able to test this and is it working now? If we don't get a reply in the next week we will likely close the issue |
Hi, could not test it yet, will do it this week end, then I'll let you know
the results
Thanks for the reminder!
El jue., 10 jun. 2021 11:05 a. m., David Burns ***@***.***>
escribió:
… @AlfGod <https://github.com/AlfGod> Were you able to test this and is it
working now? If we don't get a reply in the next week we will likely close
the issue
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9479 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMOTK5VP2VED4S3Z5CXU3E3TSDBBTANCNFSM44433PVQ>
.
|
Closing this as I believe it is fixed. Please raise a new bug if this is not the case |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🐛 Bug Report
Hello Everyone,
Apologies for my english if I wrote something wrong.
My problem is that Firefox webdriver is ignoring proxy settings. So, if I open a Firefox webdriver with proxy the opened Firefox ignores the proxy settings and tries to go directly to the web page.
What's weird is that if after Firefox opens, I manualy go to Netwerk Preferences, the proxy settings are Ok. Proxy ip ok, proxy port ok, everything seems ok...
... what's MORE WEIRD is this >>> if I select Ok in order to leave "Network Preferences", now Firefox starts to use the proxy settings correctly!. This is a sort of walkaround, but its not working for me because it is a manual procedure.
The problem is that I'm need to implement an atomated script that configures proxy, opens Firefox, loads a page, performs some tasks and leave... all 100% automatic. But with this kind of bug the opened Firefox can't go trhoug the proxy, so the page never loads.
Tryed several methods:
Using desiredcapabilities parameter with proxy settings loaded on the desiredcapabilities object
Using "firefox_profile method", does not solved the issue either
profileWebdriver.set_preference("network.proxy.type", 1) # Direct = 0, Manual = 1, PAC = 2, AUTODETECT = 4, SYSTEM = 5
profileWebdriver.set_preference("network.proxy.http", 127.0.0.1)
profileWebdriver.set_preference("network.proxy.http_port", 8080)
profileWebdriver.set_preference("network.proxy.share_proxy_settings", True)
Tried "proxy parameter method", does not solved the issue either. Yes I know it's deprecated but I'm a desperate man and tried it annyway :D
Could not find in the WEB how to set proxy values on options object
Thanks in advance!
To Reproduce
Detailed steps to reproduce the behavior:
Create a webdriver object using proxy configurations
Get a webpage and check that the web page is loaded via the specified proxy
Expected behavior
Must open web pages using the proxy configuration. If proxy is down must fail, if proxy is up must use it.
The problem is that the proxy is not used.
Test script or set of commands reproducing this issue
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.common.proxy import Proxy, ProxyType
if name == 'main':
opts = Options()
opts.headless = False
----- desired_capability method
desired_capability = webdriver.DesiredCapabilities.FIREFOX
prox = Proxy()
prox.proxy_type = ProxyType.MANUAL
prox.http_proxy = "127.0.0.1:8080"
prox.add_to_capabilities(desired_capability)
----- profile method
profile = webdriver.FirefoxProfile()
profile.set_preference("dom.disable_beforeunload", True)
profile.set_preference("browser.tabs.warnOnClose", False)
PrivateMode = False
profile.set_preference("browser.privatebrowsing.autostart", PrivateMode)
profile.set_preference("browser.privatebrowsing.autostart", PrivateMode)
profile.set_preference("network.proxy.type", 1) # Direct = 0, Manual = 1, PAC = 2, AUTODETECT = 4, SYSTEM = 5
profile.set_preference("network.proxy.http", "127.0.0.1")
profile.set_preference("network.proxy.http_port", 2020)
profile.set_preference("network.proxy.share_proxy_settings", True)
profile.update_preferences()
None of the following procedures works
#1 Using firefox_profile
BrowserManager = webdriver.Firefox(options=opts, firefox_profile=profile)
#2 desired_capabilities
#BrowserManager = webdriver.Firefox(options=opts, firefox_profile=profile,
desired_capabilities=desired_capability)
#3 proxy
BrowserManager = webdriver.Firefox(options=opts,
firefox_profile=profile,
proxy=prox)
BrowserManager.get("https://whatismyipaddress.com/")
print("The End")
Environment
OS:
Browser:
Browser version:
Browser Driver version:
Language Bindings version:
Selenium Grid version (if applicable):
The text was updated successfully, but these errors were encountered: