我有一個基於WebDriver 3.5
的測試套件,編寫於Java
。 當我從IntelliJ IDEA
執行它時,它運行良好。當我在Jenkins
中構建它時,出現以下錯誤消息。需要Jenkins未知錯誤:找不到Chrome二進制文件
org.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binary (Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Windows NT 6.3.9600 x86_64) (WARNING: The server did not provide any stacktrace information)
System.setProperty("webdriver.chrome.driver", "C:\\chromedriver.exe");
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--headless");
driver = new ChromeDriver(chromeOptions);
無鉻二進制從IDE執行它。 Jenkins
與IntelliJ IDEA
安裝在同一臺機器上。
我已經在無頭模式下使用'Chrome'。 – plaidshirt
好。接下來我要檢查的是類路徑。你能在失敗之前把這個嗎?的System.out.println(System.getProperty( 「java.class.path」)); – MikeJRamsey56
您如何看待「失敗前」? – plaidshirt