<tfoot id='8QD3L'></tfoot>

    <small id='8QD3L'></small><noframes id='8QD3L'>

  1. <i id='8QD3L'><tr id='8QD3L'><dt id='8QD3L'><q id='8QD3L'><span id='8QD3L'><b id='8QD3L'><form id='8QD3L'><ins id='8QD3L'></ins><ul id='8QD3L'></ul><sub id='8QD3L'></sub></form><legend id='8QD3L'></legend><bdo id='8QD3L'><pre id='8QD3L'><center id='8QD3L'></center></pre></bdo></b><th id='8QD3L'></th></span></q></dt></tr></i><div id='8QD3L'><tfoot id='8QD3L'></tfoot><dl id='8QD3L'><fieldset id='8QD3L'></fieldset></dl></div>

      • <bdo id='8QD3L'></bdo><ul id='8QD3L'></ul>

      <legend id='8QD3L'><style id='8QD3L'><dir id='8QD3L'><q id='8QD3L'></q></dir></style></legend>

      Selenium UnreachableBrowserException - “无法启动新会话"在 SoapU

      时间:2023-07-13

      <i id='wUNCh'><tr id='wUNCh'><dt id='wUNCh'><q id='wUNCh'><span id='wUNCh'><b id='wUNCh'><form id='wUNCh'><ins id='wUNCh'></ins><ul id='wUNCh'></ul><sub id='wUNCh'></sub></form><legend id='wUNCh'></legend><bdo id='wUNCh'><pre id='wUNCh'><center id='wUNCh'></center></pre></bdo></b><th id='wUNCh'></th></span></q></dt></tr></i><div id='wUNCh'><tfoot id='wUNCh'></tfoot><dl id='wUNCh'><fieldset id='wUNCh'></fieldset></dl></div>
            <tfoot id='wUNCh'></tfoot>
            • <bdo id='wUNCh'></bdo><ul id='wUNCh'></ul>

              <small id='wUNCh'></small><noframes id='wUNCh'>

                <legend id='wUNCh'><style id='wUNCh'><dir id='wUNCh'><q id='wUNCh'></q></dir></style></legend>
                  <tbody id='wUNCh'></tbody>

                本文介绍了Selenium UnreachableBrowserException - “无法启动新会话"在 SoapUI Groovy 测试步骤中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我在 Win7 x32 上使用 SoapUI Pro 5.1.2,并尝试在 Groovy TestStep 中连接到 Selenium Webdriver.

                I use SoapUI Pro 5.1.2 on Win7 x32, and try to connect to Selenium Webdriver in Groovy TestStep.

                为此,我在 $SOAP_HOME$inext 文件夹中添加了 selenium-standalone-server.jar v2.45.0.

                For this purpose I added selenium-standalone-server.jar v2.45.0 in $SOAP_HOME$inext folder.

                我的 Groovy TestStep 代码:

                My Groovy TestStep code:

                import org.openqa.selenium.WebDriver
                import org.openqa.selenium.chrome.ChromeDriver
                
                System.setProperty('webdriver.chrome.driver', 'C:\\Windows\system32\chromedriver.exe')
                log.info(System.getProperty('webdriver.chrome.driver')) //got 'C:\Windowssystem32chromedriver.exe'
                
                WebDriver driver = new ChromeDriver() // this line causes error
                
                driver.get('http://google.com')
                driver.quit()
                

                当我尝试运行此步骤时,SoapUI 返回消息:

                When I try to run this step, SoapUI returns message:

                org.openqa.selenium.remote.UnreachableBrowserException: 
                Could not start a new session. 
                Possible causes are invalid address of the remote server or browser start-up failure. 
                Build info: 
                    version: '2.45.0', 
                    revision: '5017cb8', 
                    time: '2015-02-26 23:59:50' 
                System info: 
                    host: 'SmithPC', 
                    ip: '10.0.2.15', 
                    os.name: 'Windows 7', 
                    os.arch: 'x86', 
                    os.version: '6.1', 
                    java.version: '1.8.0_45' 
                Driver info: 
                    driver.version: ChromeDriver 
                error at line: 7
                

                在将相同的 selenium-standalone-server.jar 包添加到空的 java 项目后,我尝试通过 Netbeans IDE 运行这段代码.它已经顺利完成了!

                I tried to run this piece of code through the Netbeans IDE, after adding the same selenium-standalone-server.jar package to empty java project. And it has completed without problems!

                这是soapUI的错误日志:

                This is error-log of soapUI:

                org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
                Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50'
                System info: host: 'SmithPC', ip: '10.0.2.15', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_45'
                Driver info: driver.version: ChromeDriver
                    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:593)
                    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
                    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:126)
                    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:139)
                    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:171)
                    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:160)
                    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:117)
                    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
                    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
                    at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
                    at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
                    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57)
                    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
                    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:186)
                    at Script3.run(Script3.groovy:7)
                    at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:92)
                    at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SourceFile:79)
                    at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:138)
                    at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:250)
                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                    at java.lang.Thread.run(Thread.java:745)
                Caused by: java.lang.NullPointerException
                    at org.apache.http.impl.conn.SystemDefaultRoutePlanner.determineProxy(SystemDefaultRoutePlanner.java:79)
                    at org.apache.http.impl.conn.DefaultRoutePlanner.determineRoute(DefaultRoutePlanner.java:77)
                    at org.apache.http.impl.client.InternalHttpClient.determineRoute(InternalHttpClient.java:124)
                    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:183)
                    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)
                    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
                    at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:126)
                    at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:72)
                    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:133)
                    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:66)
                    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:572)
                    ... 23 more
                

                我也试过用 FirefoxDriver() 代替 ChromeDriver(),得到了同样的错误.

                I also tried use FirefoxDriver() instead of ChromeDriver(), and got the same error.

                推荐答案

                我也遇到同样的错误,说:

                I have encountered the same error, which said:

                org.openqa.selenium.remote.UnreachableBrowserException:无法启动新会话.可能的原因是远程服务器地址无效或浏览器启动失败.

                org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.

                chromedriver.exe 开始正常.我可以在任务管理器中看到它.

                but chromedriver.exe started fine. I can see it in task manager.

                我的环境如下,

                • Windows 7,终极版,64 位系统
                • selenium-server-standalone-2.47.1
                • chromedriver 2.19
                • 谷歌浏览器:45.0

                在谷歌结果中建议多次尝试后,我的最终解决方案是将 127.0.0.1 localhost 添加到 C:WindowsSystem32driversetchosts.

                After many tries suggested in google results, my final solution is to add 127.0.0.1 localhost to C:WindowsSystem32driversetchosts.

                希望能帮到你!

                这篇关于Selenium UnreachableBrowserException - “无法启动新会话"在 SoapUI Groovy 测试步骤中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:防止在 selenium webdriver 测试中加载外部内容 下一篇:保持用户登录 - 使用网络驱动程序保存 cookie

                相关文章

                <tfoot id='idJF7'></tfoot>

                <small id='idJF7'></small><noframes id='idJF7'>

                    <legend id='idJF7'><style id='idJF7'><dir id='idJF7'><q id='idJF7'></q></dir></style></legend>

                    • <bdo id='idJF7'></bdo><ul id='idJF7'></ul>
                  1. <i id='idJF7'><tr id='idJF7'><dt id='idJF7'><q id='idJF7'><span id='idJF7'><b id='idJF7'><form id='idJF7'><ins id='idJF7'></ins><ul id='idJF7'></ul><sub id='idJF7'></sub></form><legend id='idJF7'></legend><bdo id='idJF7'><pre id='idJF7'><center id='idJF7'></center></pre></bdo></b><th id='idJF7'></th></span></q></dt></tr></i><div id='idJF7'><tfoot id='idJF7'></tfoot><dl id='idJF7'><fieldset id='idJF7'></fieldset></dl></div>