51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 3273|回复: 6
打印 上一主题 下一主题

[原创] Day4-1测试积点任务

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

    连续签到: 3 天

    [LV.9]测试副司令

    跳转到指定楼层
    1#
    发表于 2018-5-10 14:10:14 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    1测试积点
    问题:
    求助:python+selenium 启动 Chrome 时,加载用户配置文件,启动报错
    依照网上的设置,代码如下:


    1. <font face="微软雅黑" size="3">from selenium import webdriver
    2. options = webdriver.ChromeOptions()
    3. options.add_argument('--profile-directory=Default')
    4. options.add_argument('--user-data-dir=C:\Users\admin\AppData\Local\Google\Chrome\User Data\Profile 4')
    5. browser = webdriver.Chrome(chrome_options=options)

    6. 报错信息如下:
    7. Traceback (most recent call last):
    8. File "C:/Users/admin/PycharmProjects/testdemo/555.py", line 11, in
    9. browser = webdriver.Chrome(chrome_options=options)
    10. File "C:\Python27\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 69, in init
    11. desired_capabilities=desired_capabilities)
    12. File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 92, in init
    13. self.start_session(desired_capabilities, browser_profile)
    14. File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 179, in start_session
    15. response = self.execute(Command.NEW_SESSION, capabilities)
    16. File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 238, in execute
    17. self.error_handler.check_response(response)
    18. File "C:\Python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 193, in check_response
    19. raise exception_class(message, screen, stacktrace)
    20. selenium.common.exceptions.WebDriverException: Message: unknown error: cannot create default profile directory
    21. (Driver info: chromedriver=2.28.455520 (cc17746adff54984afff480136733114c6b3704b),platform=Windows NT 10.0.14393 x86_64)</font>
    复制代码



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

    使用道具 举报

  • TA的每日心情
    开心
    2021-12-27 08:30
  • 签到天数: 471 天

    连续签到: 1 天

    [LV.9]测试副司令

    2#
    发表于 2018-5-17 09:21:44 | 只看该作者
    应该是没有响应
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    4 天前
  • 签到天数: 1389 天

    连续签到: 3 天

    [LV.10]测试总司令

    3#
    发表于 2018-5-17 10:11:45 | 只看该作者
    兼容性问题?
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    4 天前
  • 签到天数: 2663 天

    连续签到: 3 天

    [LV.Master]测试大本营

    4#
    发表于 2018-5-17 10:19:55 | 只看该作者
    看不出来,还有其他的吗
    回复

    使用道具 举报

  • TA的每日心情

    2024-4-19 09:36
  • 签到天数: 942 天

    连续签到: 1 天

    [LV.10]测试总司令

    5#
    发表于 2018-5-17 11:16:03 | 只看该作者
    兼容性问题?
    回复

    使用道具 举报

  • TA的每日心情

    2020-2-2 12:43
  • 签到天数: 630 天

    连续签到: 1 天

    [LV.9]测试副司令

    6#
    发表于 2018-5-17 14:20:05 | 只看该作者
    无法创建默认配置文件目录,是不是啥东西没配好
    回复

    使用道具 举报

  • TA的每日心情

    2020-2-2 12:43
  • 签到天数: 630 天

    连续签到: 1 天

    [LV.9]测试副司令

    7#
    发表于 2018-5-17 14:20:26 | 只看该作者
    无法创建默认配置文件目录,是不是啥东西没配好
    回复

    使用道具 举报

    本版积分规则

    关闭

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

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

    GMT+8, 2024-5-4 15:45 , Processed in 0.072135 second(s), 21 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

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