【问题标题】:Open firefox window in selenium with firefox addons loaded?在加载了firefox插件的硒中打开firefox窗口?
【发布时间】:2010-11-11 10:57:48
【问题描述】:

当我在 selenium 中运行测试时,新打开的 firefox 窗口在没有我安装的插件(如 xpathchecker)的情况下打开。

是否可以设置 selenium 以便它使用带有已安装插件的 firefox?

【问题讨论】:

  • 你是如何使用 selenium-remote control(rc) 启动 firefox 的?
  • 我正在使用sharp develop通过nunit modul编辑和运行selenium c#脚本... selenium RC只需要安装在你的硬件上

标签: c# firefox selenium firefox-addon


【解决方案1】:

如果你使用的是 selenium 遥控器,

  1. 您可能需要create a separate profile 来测试您的插件。
  2. 之后,您可以在该新配置文件中安装插件。记下配置文件管理器中配置文件文件夹的路径或在此处查看您的profile folder
  3. 然后当你启动 selenium 时,使用

    -firefoxProfileTemplate "配置文件路径"

指定已安装插件的配置文件的位置。

【讨论】:

    【解决方案2】:

    只是添加。从 java 运行 RC 时,您可以使用:

    RemoteControlConfiguration server_preferences = new RemoteControlConfiguration();  
    File f = new File('/home/user/.mozilla/firefox/qa/'); // 'qa' is my profile folder name
    server_preferences.setFirefoxProfileTemplate(f);  
    (...)   
    myServer = new SeleniumServer(server_preferences);  
    myServer.start();  
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-08-27
      • 1970-01-01
      • 2013-06-17
      • 1970-01-01
      • 1970-01-01
      • 2012-06-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多