Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
531 views
in Technique[技术] by (71.8m points)

Java, Selenium and Chromium portable

Probably someone with Linux, Java, Selenium and using Chrome webdriver with Chromium Portable can help.

My chrome driver is at /opt/chromedriver/chromedriver

Also, my portable chromium is at /opt/chromium/

I've set the binary using chrome options as well as the chromedriver path as given below

System.setProperty("webdriver.chrome.driver", "/opt/chromedriver/chromedriver");
ChromeOptions option= new ChromeOptions();
option.setBinary("/opt/chromium/chrome");
option.addArguments("--no-sandbox");
option.addArguments("--no-default-browser-check");
option.addArguments("--no-first-run");
option.addArguments("--disable-gpu");
option.addArguments("--disable-extensions");
option.addArguments("--disable-default-apps");
WebDriver webDriver = new ChromeDriver(option);

I am getting the below exception

/opt/chromium/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.

In case, I install chromium on my centos machine using the below commands, it works as expected
$ sudo yum install -y epel-release
$ sudo yum install -y chromium

Any idea? Thank you very much in advance and have a nice day -Chetan


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...