Selenium Webdriver - How to set proxy to “auto-detect” for Firefox

前端 未结 3 1164
自闭症患者
自闭症患者 2021-01-14 04:42

My scripts are running fine on chrome and IE but won\'t start on firefox due to firefox having \"manual\" set for its proxy settings. How can I set this to \"auto-detect\"?<

3条回答
  •  渐次进展
    2021-01-14 05:32

    Thanks for your help AJ.

    I used the following code to solve my problem:

    FirefoxBinary binary = new FirefoxBinary("C:\\Program Files\\Mozilla Firefox\\firefox.exe");
    FirefoxProfile profile = new FirefoxProfile("C:\\test profile\\");          driver = new FirefoxDriver(binary, profile);
    

    I simply copied the contents of my Mozilla profile to "c:\test profile\". This allowed me to run the test via Selenium but also keep other firefox instances open.

提交回复
热议问题