硒服务器不启动自定义Firefox的配置文件 [英] Selenium server not starting for custom firefox profile

查看:150
本文介绍了硒服务器不启动自定义Firefox的配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过传递自定义firefox配置文件到DefaultSelenium构造函数来启动硒服务器。它使用指定的URL打开浏览器。

  DefaultSelenium selenium = new DefaultSelenium(localhost,4444,* custom \ C:/ Program Files / Mozilla Firefox / firefox.exe \,ReadConFile.readcoFile(serverName)); 
selenium.start();

日志是

  16:39:19.246信息 - 为https://< myURL>分配的会话4eb63d37a4ba4d2fb4e351f8f59e3ea6,启动... 

然后它保持这样,服务器不启动。然而,如果我不使用自定义配置文件,这工作正常。

  DefaultSelenium selenium = new DefaultSelenium(localhost,4444,* chrome,ReadConFile.readcoFile(serverName)) ; 
selenium.start();

我需要启动自定义配置文件,因为我保存了https所需的一些站点证书。另外,我从eclipse执行这个。



我想我的服务器没有配置为启动自定义配置文件。请帮助我。

开始 命令并不真正开始您的硒服务器本身,它将您的硒对象连接到已经运行的服务器与您选择的浏览器。



要实际启动硒[Jetty Web]服务器,通过您指定的浏览器向您的应用程序发送/接收命令,使用批处理文件和开关 rs79 指的是。你的批处理文件的内容应该包含他的行:

  java -jar selenium-server-standalone-2.0a5.jar -firefoxProfileTemplate C:\custom-firefox-profile 

现在你的开发机器上运行了一个真正的selenium服务器(本地主机)与默认的4444端口。这将指定任何Firefox浏览器测试将使用此配置文件。

现在您的DefaultSelenium构造函数,赋值和其他调用可能如下所示:

  DefaultSelenium selenium = new DefaultSelenium(localhost,4444,* firefox,http://www.server.com); 
selenium.start()
selenium.open(myApp /)

Firefox将开始使用启动Selenium服务器的批处理文件中指定的自定义配置文件以及所需的基本URL,然后导航到您想要的应用程序[URL]。如果您是从 http://www.server.com/ 开始测试,而不是 http://www.server.com/myApp ,你可以省略最后一个打开行。


I'm trying to start the selenium server by passing custom firefox profile to the DefaultSelenium constructor. It opens the browser with specified URL.

DefaultSelenium selenium = new DefaultSelenium("localhost", 4444, "*custom \"C:/Program Files/Mozilla Firefox/firefox.exe\"",ReadConFile.readcoFile("serverName"));
    selenium.start();

the log is

16:39:19.246 INFO - Allocated session 4eb63d37a4ba4d2fb4e351f8f59e3ea6 for https://<myURL>, launching...

then it stays like that and server doesn't start.

however, this works fine if I don't use custom profile.

DefaultSelenium selenium = new DefaultSelenium("localhost", 4444, "*chrome",ReadConFile.readcoFile("serverName"));
selenium.start();

I need the launch custom profile as I've saved some site certificates necessary for https. Also, I'm executing this from eclipse.

I think my server isn't configured to launch custom profile. Please help me with this.

解决方案

The start command is not really starting your selenium server per se, it's connecting your selenium object to an already running server with the browser of your choice.

To actually start the selenium [Jetty Web] server that sends / receives commands to your application under test via your specified browser, use a batch file and the switch rs79 is referring to. The contents of your batch file should include his line:

java -jar selenium-server-standalone-2.0a5.jar -firefoxProfileTemplate C:\custom-firefox-profile

Now you have a true selenium server running on your dev machine (localhost) with the default "4444" port. This will specify that any Firefox browser testing will use this profile.

Now your DefaultSelenium constructor, assignment, and other calls can look like this:

DefaultSelenium selenium = new DefaultSelenium("localhost", 4444, "*firefox","http://www.server.com");
selenium.start()
selenium.open("myApp/")

Firefox will start using the custom profile specified in the batch file that starts the Selenium server, with your desired base URL, and then navigate into your desired application [URL]. If you are beginning your test from "http://www.server.com/" and not "http://www.server.com/myApp", you can omit the last open line.

这篇关于硒服务器不启动自定义Firefox的配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆