gpt4 book ai didi

java - 启动 firefox24 的 Selenium 错误

转载 作者:行者123 更新时间:2023-11-28 20:54:21 25 4
gpt4 key购买 nike

我在使用 selenium 时遇到了这个问题。我无法启动测试,因为这个问题:

PHPUnit_Framework_Error :Selenium RC 服务器对 getNewBrowserSession(*firefox C:\Firefox24\firefox.exe,/) 的响应。无法启动新的浏览器 session :org.openqa.selenium.server.RemoteCommandException:启动浏览器时出错。

版本:

λ java -version
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)

Selenium : Selenium 服务器独立-2.47.1

我需要帮助,谢谢:)

完整错误:

java -jar "C:\selenium\selenium-server-standalone-2.47.1.jar" -singleWindow -browserSessionReuse
15:02:46.717 INFO - Launching a standalone Selenium Server
15:02:47.363 INFO - Java: Oracle Corporation 25.51-b03
15:02:47.364 INFO - OS: Windows 7 6.1 amd64
15:02:47.372 INFO - v2.47.1, with Core v2.47.1. Built from revision 411b314
15:02:47.372 INFO - Will recycle browser sessions when possible.
15:02:47.428 INFO - Driver class not found: com.opera.core.systems.OperaDriver
15:02:47.428 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
15:02:47.610 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
15:02:47.611 INFO - Selenium Server is up and running
15:03:00.087 INFO - Command request: getNewBrowserSession[*firefox C:\Firefox24\firefox.exe, /] on session null
15:03:00.089 INFO - grabbing available session...
15:03:00.090 INFO - creating new remote session
15:03:00.147 INFO - Allocated session 8d5c66b5a2d841819be7fcb7202bc4d8 for /, launching...
15:03:00.149 ERROR - Failed to start new browser session, shutdown browser and clear all session data
java.lang.RuntimeException: java.net.MalformedURLException: no protocol: /
at org.openqa.selenium.net.Urls.toProtocolHostAndPort(Urls.java:47)
at org.openqa.selenium.server.browserlaunchers.LauncherUtils.getDefaultRemoteSessionUrl(LauncherUtils.java:133)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launchRemoteSession(FirefoxChromeLauncher.java:320)
at org.openqa.selenium.server.browserlaunchers.FirefoxLauncher.launchRemoteSession(FirefoxLauncher.java:102)
at org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession(BrowserSessionFactory.java:400)
at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:144)
at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:105)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession(SeleniumDriverResourceHandler.java:818)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:435)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:405)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:151)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1526)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1479)
at org.openqa.jetty.http.HttpServer.service(HttpServer.java:920)
at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:358)
at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:537)
Caused by: java.net.MalformedURLException: no protocol: /
at java.net.URL.<init>(URL.java:586)
at java.net.URL.<init>(URL.java:483)
at java.net.URL.<init>(URL.java:432)
at org.openqa.selenium.net.Urls.toProtocolHostAndPort(Urls.java:37)
... 19 more

最佳答案

我在使用较新版本的 Firefox 时遇到过这个问题。使用 Firefox 34.0.5,它应该可以正常工作。

关于java - 启动 firefox24 的 Selenium 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31833555/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com