栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

webdriver.FirefoxProfile():是否可以不复制配置文件就使用配置文件?

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

webdriver.FirefoxProfile():是否可以不复制配置文件就使用配置文件?

按照 GeckoDriverFirefox上 的当前实现,其

FirefoxProfile()
工作方式如下:

  • 如果通过以下方式通过新的 Firefox配置文件* 启动 浏览会话*
        from selenium import webdriver    myprofile = webdriver.FirefoxProfile()    driver = webdriver.Firefox(firefox_profile=myprofile, executable_path=r'C:UtilityBrowserDriversgeckodriver.exe')    driver.get('https://www.google.co.in')    print("Page Title is : %s" %driver.title)    driver.quit()
  • 运行时将创建一个新的 rust_mozprofile ,如下所示:
        1521446301607   mozrunner::runner   INFO    Running command: "C:\Program Files\Mozilla Firefox\firefox.exe" "-marionette" "-profile" "C:\Users\ATECHM~1\AppData\Local\Temp\rust_mozprofile.xFayqKkZrOB8"
  • 在成功关闭(即成功调用

    driver.quit()
    )时,粗临时 rust_mozprofile.xFayqKkZrOB8 会被完全删除/销毁。

  • 再次通过 现有的 Firefox Profile()* 启动 浏览会话的 情况如下: __*

        from selenium import webdriver    myprofile = webdriver.FirefoxProfile(r'C:UsersAtechM_03AppDataRoamingMozillaFirefoxProfilesmoskcpdq.SeleniumTest')    driver = webdriver.Firefox(firefox_profile=myprofile, executable_path=r'C:UtilityBrowserDriversgeckodriver.exe')    driver.get('https://www.google.co.in')    print("Page Title is : %s" %driver.title)    driver.quit()
  • 同样,将在运行时创建一个新的 rust_mozprofile ,如下所示:
        1521447102321   mozrunner::runner   INFO    Running command: "C:\Program Files\Mozilla Firefox\firefox.exe" "-marionette" "-profile" "C:\Users\ATECHM~1\AppData\Local\Temp\rust_mozprofile.2oSwrQwQoby9"
  • 同样,在这种情况下,以及在成功关闭(即成功调用

    driver.quit()
    )后,临时 rust_mozprofile.2oSwrQwQoby9也会 被完全删除/销毁。

  • 因此,您正在观察的 时间跨度

    FirefoxProfile()
    挖出新的 rust_mozprofile 所需的时间。

也许根据您的问题的时间跨度 来复制配置文件(大约30分钟以上) 纯属开销。因此,如果不复制,就无法使用
Firefox配置文件

rust_mozprofile


  • Selenium Client 升级到当前 版本3.11.0
  • 升级 GeckoDriver 当前 GeckoDriver v0.20.0 水平。
  • Firefox 版本升级到 Firefox Quantum v59.0.1 级别。
  • 清理 你的 项目工作 ,通过你的 IDE重建 仅需要依赖你的项目。
  • 在执行 测试套件 之前和之后,使用 CCleaner 工具清除所有操作系统琐事。 __
  • 如果您的基本 Firefox 基本版本太旧,请通过 Revo Uninstaller 卸载它,并安装最新的GA和 Firefox Quantum的 发行版本。
  • 执行您的
    @Test


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/426720.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号