问题描述
我喜欢初始化
公共无效设置()抛出异常结果
{结果
设置(HTTP://本地主机/,*火狐);结果,
}结果
public void setUp() throws Exception
{
setUp("http://localhost/", "*firefox");
}
和我写我的方法测试像
公共无效testUntitled()抛出异常结果
{结果
BOO();结果
富();结果
}
public void testUntitled() throws Exception
{
boo();
foo();
}
但它给错误,如
了java.lang.RuntimeException:同时发动浏览器错误:无法启动会话硒:无法启动新的浏览器会话
在com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:89)
在com.thoughtworks.selenium.SeleneseTestBase.setUp(SeleneseTestBase.java:123)
在com.thoughtworks.selenium.SeleneseTestBase.setUp(SeleneseTestBase.java:104)
在com.thoughtworks.selenium.SeleneseTestCase.setUp(SeleneseTestCase.java:78)
在ComserTest_v2.setUp(ComserTest_v2.java:12)
在junit.framework.TestCase.runBare(TestCase.java:132)
在com.thoughtworks.selenium.SeleneseTestCase.runBare(SeleneseTestCase.java:212)
在junit.framework.TestResult $ 1.protect(TestResult.java:110)
在junit.framework.TestResult.runProtected(TestResult.java:128)
在junit.framework.TestResult.run(TestResult.java:113)
在junit.framework.TestCase.run(TestCase.java:124)
在junit.framework.TestSuite.runTest(TestSuite.java:232)
在junit.framework.TestSuite.run(TestSuite.java:227)
在org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
在org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
在org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
在org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
在org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
在org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
在org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
com.thoughtworks.selenium.SeleniumException:引起同时发动浏览器错误:无法启动新的浏览器会话
在com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)
在com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91)
在com.thoughtworks.selenium.HttpCommandProcessor.getString(HttpCommandProcessor.java:262)
在com.thoughtworks.selenium.HttpCommandProcessor.start(HttpCommandProcessor.java:223)
在com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:81)
... 19多个
java.lang.RuntimeException: Could not start Selenium session: Failed to start new browser session: Error while launching browser at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:89) at com.thoughtworks.selenium.SeleneseTestBase.setUp(SeleneseTestBase.java:123) at com.thoughtworks.selenium.SeleneseTestBase.setUp(SeleneseTestBase.java:104) at com.thoughtworks.selenium.SeleneseTestCase.setUp(SeleneseTestCase.java:78) at ComserTest_v2.setUp(ComserTest_v2.java:12) at junit.framework.TestCase.runBare(TestCase.java:132) at com.thoughtworks.selenium.SeleneseTestCase.runBare(SeleneseTestCase.java:212) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)Caused by: com.thoughtworks.selenium.SeleniumException: Failed to start new browser session: Error while launching browser at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97) at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91) at com.thoughtworks.selenium.HttpCommandProcessor.getString(HttpCommandProcessor.java:262) at com.thoughtworks.selenium.HttpCommandProcessor.start(HttpCommandProcessor.java:223) at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:81) ...19 more
我无法找到一个解决方案,我和在谷歌的结果。任何帮助将AP preciated。
I could not find a solution myself and in google results. Any help will be appreciated.
不管怎样,谢谢。
推荐答案
火狐只允许每个配置文件的一个实例。如果你没有为它conigure任何东西,在测试开始时,Firefox浏览器是开放的。火狐块硒使用它。
Firefox only allows one instance of each profile. If you did not conigure anything for it and your firefox browser is open when starting the test. Firefox blocks selenium from using it.
配置在Firefox的配置文件,您可以配置硒使用FF配置文件
Configure a profile in Firefox and you can configure selenium to use a ff profile
当你运行Selenium服务器,运行与服务器
命令行选项-firefoxProfileTemplate路径轮廓
when you run Selenium Server, run with the server withcommand-line option -firefoxProfileTemplate "path to the profile"
(如果你没有配置的)
配置配置文件
这篇关于同时发动浏览器错误:无法启动会话硒:无法启动新的浏览器会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!