简体   繁体   English

如何在没有 ChromeDriver.exe 的情况下从 Selenium 远程 Web 驱动程序启动 GoogleChrome

[英]How to Launch GoogleChrome from Selenium Remote Web Driver without ChromeDriver.exe

I want to launch Google chrome on server without using ChromeDriver.exe Currently trying with RemoteWebDriver , but getting below error我想在不使用 ChromeDriver.exe 的情况下在服务器上启动 Google chrome 目前正在尝试使用 RemoteWebDriver ,但出现以下错误

Code I am trying:我正在尝试的代码:

public class DEMO {
   public static void main(String[] args) throws MalformedURLException {
    // create a Chrome Web Driver
       URL local = new URL("http://localhost:8080");
       WebDriver driver = new RemoteWebDriver(local, DesiredCapabilities.chrome());
       // open the browser and go to open google.com
       driver.get("https://www.google.com"); 


       driver.manage().window().maximize();
   }

Error :错误 :

Exception in thread "main" org.openqa.selenium.UnsupportedCommandException: <html><head><title>Apache Tomcat/7.0.47 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - /session</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/session</u></p><p><b>description</b> <u>The requested resource is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.47</h3></body></html>
Command duration or timeout: 333 milliseconds
Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:01:03'

Any operation with Chrome should eventually be passed through chromedriver (.exe for Windows OS). Chrome 的任何操作最终都应通过 chromedriver(Windows 操作系统的 .exe)传递。 This is a basic conception of Selenium / WebDriver.这是 Selenium / WebDriver 的基本概念。 Will it be a remote call or local call.是远程呼叫还是本地呼叫。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM