我正试图在远程机器上启动一个自定义的firefox配置文件,从Windows XP启动到Mac OS X。浏览器使用自定义配置文件启动,但在相同的url路径上打开设置的url和远程运行程序(基本上不运行测试(。
设置:
selenium = new DefaultSelenium(setup.host, setup.port, setup.browser, setup.url);
selenium.start();
拉动这个:
static String host = "192.168.224.49";
static int port = 4444;
static String browser = "*custom"+" "+"//Applications//Firefox.app//Contents//MacOS/firefox-bin"+" "+"-P"+" "+"Selenium";
static String url = "http://test.Example.com";
打开浏览器并使用正确的配置文件,但没有正确加载URL。
任何帮助都将不胜感激!
要使用customProfile启动firefox,不需要将其作为自定义浏览器打开。您应该在启动服务器时设置firefoxprofileTemplate。
如果您使用java-jar selenium server命令从命令提示符启动jar,那么您应该使用以下命令:
java -jar selenium-server -firefoxProfileTemplate <path to firefox template>
如果您使用代码启动服务器,那么您应该使用以下代码:
SeleniumServer selServer;
RemoteControlConfiguration rc;
rc.setFirefoxProfileTemplate(File which refers to FirefoxProfileTemplate)
selServer=new SeleniumServer(false,rc);
对于这两者,您应该首先使用firefox-p命令创建firefox概要文件。