selenium啟動的firefox開啟新的匿名的profiles

fabbymee發表於2015-10-16

用selenium啟動的firefox跟手動開啟的firefox不一樣。

比如我電腦上firefox有裝了迅雷的外掛。但是用selenium啟動的firefox沒有看到迅雷外掛

firefox的profile路徑

  • In the Firefox menu, click on the "Help" menu item ("?" in current versions) and select "Troubleshooting Information". (Alternatively, enter about:support in the address bar.) Theabout:support page will open.
  • Under "Application Basics",
    • On Windows and Linux, depending on Firefox version, click on "Show Folder" (Windows) "Open Directory" (Linux) or "Open Containing Folder".
    • On Mac OS, click on "Show in Finder".
開啟預設profile

ffBinary = new FirefoxBinary(pathToBinary);
profileIni=new ProfilesIni(); 
firefoxProfile = profileIni.getProfile("default");

如何建立一個新的firefox profile

http://www.toolsqa.com/selenium-webdriver/custom-firefox-profile/



相關文章