MachinePublishers / jBrowserDriver

A programmable, embeddable web browser driver compatible with the Selenium WebDriver spec -- headless, WebKit-based, pure Java
Other
809 stars 143 forks source link

org.openqa.selenium.WebDriverException: Could not launch browser #361

Closed zhangHeFei closed 4 years ago

zhangHeFei commented 4 years ago

when I build the JBrowser driver, I meet the exception:

org.openqa.selenium.WebDriverException: Could not launch browser. Build info: version: 'unknown', revision: 'unknown', time: 'unknown' System info: host: 'xxx', ip: '172.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.2.0-4-amd64', java.version: '1.8.0_121' Driver info: driver.version: JBrowserDriver at com.machinepublishers.jbrowserdriver.Util.handleException(Util.java:136) ~[jbrowserdriver-1.1.1.jar!/:?] at com.machinepublishers.jbrowserdriver.JBrowserDriver.(JBrowserDriver.java:340) ~[jbrowserdriver-1.1.1.jar!/:?]

I see source code, this problem is due to actualPortGroup is null. In addition, my code run on the window successfully, but fail to run on the Linux.

this is build driver code: Dimension dimension = new Dimension(1000, 6000); JBrowserDriver driver = new JBrowserDriver(Settings.builder() .javaOptions("-classpath", "./path/to/jbrowser-uberjar.jar") .timezone(Timezone.ASIA_SHANGHAI) .screen(dimension) .connectionReqTimeout(1000) .socketTimeout(2000) .build());

.javaOptions("-classpath", "./path/to/jbrowser-uberjar.jar") is solution I found from Internet, but that doesn’t work. And what is jbrowser-uberjar.jar??? please help me.