selenium2 浏览器版本问题

一、chrome浏览器

chrome浏览器与驱动版本对应关系

----------ChromeDriver v2.26 (2016-12-09)----------
Supports Chrome v53-55


----------ChromeDriver v2.25 (2016-10-25)----------
Supports Chrome v53-55


----------ChromeDriver v2.24 (2016-09-09)----------
Supports Chrome v52-54


----------ChromeDriver v2.23 (2016-08-04)----------
Supports Chrome v51-53


----------ChromeDriver v2.22 (2016-06-06)----------
Supports Chrome v49-52
----------ChromeDriver v2.21 (2016-01-28)---------- Supports Chrome v46-50 ----------ChromeDriver v2.20 (2015-10-08)---------- Supports Chrome v43-48 ----------ChromeDriver v2.19 (2015-08-28)---------- Supports Chrome v43-47 ----------ChromeDriver v2.18 (2015-08-19)---------- Supports Chrome v43-46

 

二、firefox浏览器版本的问题

Firefox 48+需要驱动

原文链接:https://github.com/SeleniumHQ/selenium/issues/2739

Every case here appears to be that where everyone is attempting to use Firefox 48 (or greater) with the 'old' FirefoxDriver implementation.

If you are using Firefox 48+ you need to use GeckoDriver://Firefox 48+版本需要配合使用GeckoDriver+selenium3+python3,之前的版本使用selenium2(自带Firefox浏览器的driver)。
https://github.com/mozilla/geckodriver

The old FirefoxDriver by the selenium project no longer works due to extension signing and mozilla's refusal to sign it. But even if they did sign it, or one used an 'unbranded' build of firefox, the extension will likely stop working soon due to other changes to Firefox.

Which is why in 3.0 beta releases (they are marked as beta in pypi, why a pip install -U will not pick it up), webdriver.Firefox will default to using Mozilla's geckodriver. Similar to chromedriver / IEDriverServer / EdgeDriver / phantomjs. It is a separate binary on your system that you need to download and put on your system path.

There are quite a few issues with using Firefox 48 and GeckoDriver, that are fixed in FirefoxNightly. I would recommend attempting to see how well your test suite does with FirefoxNightly when trying to switch to GeckoDriver.

To continue to use the old FirefoxDriver on FF 47.0.1 or earlier versions (excluding 47.0 ~ which doesn't work with selenium), you should be setting the DesiredCapability "marionette": False:

driver = webdriver.Firefox(capabilities={"marionette":False})

If you believe you are receiving this error other than a version mismatch with Firefox and the driver implementation issue, then please log a new issue.

I've adjusted the error message in 649b118 but I fear that will not do enough to help users.

 

This address isn't valid问题

使用selenium2打开一个Firefox浏览器时,会提示this address isn't valid。这里给出解决方法。

原文链接:https://support.mozilla.org/zh-CN/questions/1046778

Do a clean reinstall and delete the Firefox program folder before (re)installing a fresh copy of the current Firefox release.//重新安装Firefox浏览器,一定要卸载干净。

If possible uninstall your current Firefox version to cleanup the Windows registry and settings in security software.

  • Do NOT remove "personal data" when you uninstall your current Firefox version, because this will remove all profile folders and you lose personal data like bookmarks and passwords including data in profiles created by other Firefox versions.//profile文件内的个人数据可以保留。

Remove the Firefox program folder before installing that newly downloaded copy of the Firefox installer.//卸载后,如果遗留下面文件夹,那么需要删除掉。

  • (32 bit Windows) "C:\Program Files\Mozilla Firefox\"
  • (64 bit Windows) "C:\Program Files (x86)\Mozilla Firefox\"

Your bookmarks and other personal data are stored in the Firefox profile folder and won't be affected by an uninstall and (re)install, but make sure NOT to remove personal data when you uninstall Firefox as that will remove all Firefox profile folders and you lose your personal data.

If you keep having problems then also create a new profile.//如果重新安装Firefox后,还是存在问题,那么需要指定一个profile。

例如:

profile = webdriver.FirefoxProfile('C:/Users/pdmi/AppData/Roaming/Mozilla/Firefox/Profiles/8j5oylq6.default')

driver = webdriver.Firefox(firefox_profile=profile)

 

 

posted @ 2016-12-21 16:14  超级宝宝11  阅读(307)  评论(0编辑  收藏  举报