51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 2715|回复: 0
打印 上一主题 下一主题

【转】selenium和Firefox版本不兼容

[复制链接]
  • TA的每日心情
    无聊
    5 天前
  • 签到天数: 941 天

    连续签到: 3 天

    [LV.10]测试总司令

    跳转到指定楼层
    1#
    发表于 2016-10-21 14:34:59 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    selenium8.py
    coding = utf-8
    from selenium import webdriver
    driver = webdriver.Firefox()
    driver.get('http://www.baidu.com')
    print (driver.title)
    driver.quit()

    运行报错:

    Python 3.3.5 (v3.3.5:62cf4e77f785, Mar 9 2014, 10:37:12) [MSC v.1600 32 bit (Intel)] on win32
    Type "copyright", "credits" or "license()" for more information.
    ================================ RESTART ================================

    Traceback (most recent call last):
    File "C:\Python33\selenium8.py", line 3, in
    driver = webdriver.Firefox()
    File "C:\Python33\lib\site-packages\selenium-2.45.0-py3.3.egg\selenium\webdriver\firefox\webdriver.py", line 59, in init
    self.binary, timeout),
    File "C:\Python33\lib\site-packages\selenium-2.45.0-py3.3.egg\selenium\webdriver\firefox\extension_connection.py", line 47, in init
    self.binary.launch_browser(self.profile)
    File "C:\Python33\lib\site-packages\selenium-2.45.0-py3.3.egg\selenium\webdriver\firefox\firefox_binary.py", line 66, in launch_browser
    self._wait_until_connectable()
    File "C:\Python33\lib\site-packages\selenium-2.45.0-py3.3.egg\selenium\webdriver\firefox\firefox_binary.py", line 105, in _wait_until_connectable
    raise WebDriverException("Can't load the profile. Profile "
    selenium.common.exceptions.WebDriverException: Message: Can't load the profile. Profile Dir: %s If you specified a log_file in the FirefoxBinary constructor, check it for details.
    估计很多朋友都遇到过啊,网上搜了下是版本问题。
    我的selenium版本是selenium-2.45.0,安装的fireFox最新的47版本,结果就报错了。
    fireFox更新的快,但是selenium总是慢半拍。
    反正现在是学习嘛,换FireFox版本吧
    也不知道selenium-2.45.0,到底支持哪个版本的FireFox,百度搜索到一篇之前的文章说selenium-2.45.0,新发布了,支持FireFox36
    一下子降低了11个版本号,好吧,反正是学习。
    卸载新的FireFox,安装了36的版本。

    接着运行:

    ================================ RESTART ================================

    百度一下,你就知道

    看来是通过了。
    那么接下来就是学习selenium了,嘿嘿。又前进了一步!!

    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏1
    回复

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-5-5 12:38 , Processed in 0.066884 second(s), 26 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表