Can't start chrome driver via selenium in headless mode -
i've got problem. have application should run on linux server not gui want run headless. on local machine works fine on server have problem , don't know why, yesterday worked i'm getting error:
org.openqa.selenium.webdriverexception: unknown error: chrome failed start: exited abnormally (driver info: chromedriver=2.25.426924 (649f9b868f6783ec9de71c123212b908bf3b232e),platform=linux 4.4.0-47-generic x86_64) (warning: server did not provide stacktrace information) command duration or timeout: 60.07 seconds build info: version: 'unknown', revision: 'unknown', time: 'unknown' system info: host: 'vps334949', ip: '92.222.74.219', os.name: 'linux', os.arch: 'amd64', os.version: '4.4.0-47-generic', java.version: '1.8.0_111' driver info: org.openqa.selenium.chrome.chromedriver @ sun.reflect.generatedconstructoraccessor54.newinstance(unknown source) @ sun.reflect.delegatingconstructoraccessorimpl.newinstance(delegatingconstructoraccessorimpl.java:45) @ java.lang.reflect.constructor.newinstance(constructor.java:423) @ org.openqa.selenium.remote.errorhandler.createthrowable(errorhandler.java:206) @ org.openqa.selenium.remote.errorhandler.throwifresponsefailed(errorhandler.java:158) @ org.openqa.selenium.remote.remotewebdriver.execute(remotewebdriver.java:678) @ org.openqa.selenium.remote.remotewebdriver.startsession(remotewebdriver.java:249) @ org.openqa.selenium.remote.remotewebdriver.<init>(remotewebdriver.java:131) @ org.openqa.selenium.remote.remotewebdriver.<init>(remotewebdriver.java:144) @ org.openqa.selenium.chrome.chromedriver.<init>(chromedriver.java:170) @ org.openqa.selenium.chrome.chromedriver.<init>(chromedriver.java:159) @ org.openqa.selenium.chrome.chromedriver.<init>(chromedriver.java:116)
be fore start application run these commands:
xvfb :40 & xvfb :40 -screen 0 1024x768x24 -extension randr & export display=:40
but not woriking now, please somene should problem?
this how run web driver:
system.setproperty("webdriver.chrome.driver", "/home/chrome/chromedriver"); webdriver driver = new chromedriver(); driver.manage().timeouts().pageloadtimeout(timeout, timeunit.minutes);
first, need start selenium server using xvfb-run
command. execute below command in terminal first , start execution of scripts.
xvfb-run java -jar selenium-server-standalone-2.53.jar
Comments
Post a Comment