Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
522 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 Answer

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...