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

  • 相关阅读:
    mvc中HttpPost理解
    javascrip格式
    asp.net ToString()格式汇总
    Datatable根据多行排序
    sql server 判断是否存在数据库,表,列,视图
    IsPostBack是什么意思,如何运用?
    JS apply()的使用详解
    C++设计模式-Command命令模式
    C++ 继承和包含的区别?
    命令模式
  • 原文地址:https://www.cnblogs.com/pythonClub/p/10447418.html
Copyright © 2011-2022 走看看