zoukankan      html  css  js  c++  java
  • Firefox创建firefoxprofile

    我们自动化测试的时候,有时不需要图片加载出来,提高浏览器加载速度,从而提高脚本的执行速度。另外在一些网络比较差的环境下,禁用css、图片等加载可以提高访问速度

    方法:

          1、创建自己的firefoxprofile

    关闭所有Filefox浏览窗口—》运行Firefox Manager,点击windows“开始”-->“运行”,然后在输入框输入firefox.exe -ProfileManager,

    点击“确定”按钮-》创建一个新的Profile,只需点击“创建配置文件”按钮,在接着出现的向导窗口里输入配置文件名

    现在就创建了一个独立的Firefox Profile配置文件,启动Profile配置文件的Firefox

    新建一个bat文件,输入命令行

    set MOZ_NO_REMOTE=1 
    start "" "C:Program FilesMozilla Firefox Formalfirefox.exe" -P firefoxprofile文件名

    在新打开的浏览器中,你可以随意设置火狐,这些设置都保存在你的个性化firefoxprofile中

         2、现在使用selenium调用firefoxprofile

    firefox_profile = webdriver.FirefoxProfile("D:Downloads")

    browser = webdriver.Firefox(firefox_profile=firefox_profile)
    D:Downloads路径存放着我firefoxprofile

  • 相关阅读:
    虚拟机安装
    虚拟机简介
    stm32(新建工程)
    高校教室管理系统
    按键抬起有效
    数码管0~9显示
    流水灯程序设计
    P0.0口驱动一个LED闪烁
    Adobe 系列下载链接
    Microsoft 常用下载链接
  • 原文地址:https://www.cnblogs.com/pythonClub/p/10447418.html
Copyright © 2011-2022 走看看