我试图在远程机器上启动一个自定义的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。
任何帮助都将不胜感激!
发布于 2011-07-06 15:44:12
要使用customProfile启动火狐,你不需要将其作为自定义浏览器打开。您应该在启动服务器时设置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配置文件。
https://stackoverflow.com/questions/6598889
复制相似问题