Getting error while invoking the chrome browser using selenium - selenium

This is the error I am getting while running a selenium program
Exception in thread "main" java.lang.IllegalStateException: The path to the driver executable The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from https://chromedriver.storage.googleapis.com/index.html
at org.openqa.selenium.internal.Require$StateChecker.nonNull(Require.java:280)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:135)
at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:38)
at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:231)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:437)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:127)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:46)
at Selintroduction.main(Selintroduction.java:17)

Related

ERROR:gl_surface_egl.cc(750)] EGL Driver message (Critical) eglInitialize: No available renderers error using ChromeDriver and Chrome with Selenium

I am trying to execute basic python google chrome automation selenium command
I am getting below error while executing the below code:
from selenium import webdriver
chrome_path=r"xxxx\chromedriver_win32_2\chromedriver.exe"
driver= webdriver.Chrome(chrome_path)
driver.get("<somesite>")
Note:
I have windows7 64 bit OS, Chrome driver version is latest and chome browser as well latest.
ERROR:
DevTools listening on ws://127.0.0.1:12592/devtools/browser/78ac717d-857a-436c-9b28-ee18bc18fa66
[0615/004254.120:ERROR:gl_surface_egl.cc(750)] EGL Driver message (Critical) eglInitialize: No available renderers.
[0615/004254.127:ERROR:gl_surface_egl.cc(1236)] eglInitialize D3D11 failed with error EGL_NOT_INITIALIZED, trying next display type
[0615/004255.175:ERROR:gl_surface_egl.cc(750)] EGL Driver message (Critical) eglInitialize: No available renderers.
[0615/004255.176:ERROR:gl_surface_egl.cc(1236)] eglInitialize D3D9 failed with error EGL_NOT_INITIALIZED
[0615/004255.178:ERROR:gl_initializer_win.cc(196)] GLSurfaceEGL::InitializeOneOff failed.
[0615/004255.184:ERROR:viz_main_impl.cc(152)] Exiting GPU process due to errors during initialization
Code executing....
[0615/005841.064:ERROR:batching_media_log.cc(38)] MediaEvent: {"error":"MediaSource endOfStream before demuxer initialization completes (before HAVE_METADATA) is treated as an error. This may also occur as consequence of other MediaSource errors before HAVE_METADATA."}
[0615/005942.374:ERROR:batching_media_log.cc(38)] MediaEvent: {"
This error message...
[0615/004254.120:ERROR:gl_surface_egl.cc(750)] EGL Driver message (Critical) eglInitialize: No available renderers
...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.
This error is generally observed due to mismatch between selenium-chromedriver and google-chrome versions.
Solution
You need to upgrade ChromeDriver and Google Chrome version either to the latest version or to either of the compatible versions as detailed out in the discussion Protractor-selenium error message : “gl_surface_egl.cc eglInitialize D3D9 failed with error EGL_NOT_INITIALIZED”
Outro
You can find a relevant discussion in:
Issue 533043: Hardware Acceleration doesn't work on Chrome anymore. (AMD Xpress 1250)

Chromedriver error while deploy: "The path to the driver executable must be set by the webdriver.chrome.driver system property" [duplicate]

This question already has answers here:
Mac OSX - IllegalStateException: The driver is not executable:
(12 answers)
java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property
(4 answers)
java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property with Selenium GeckoDriver
(1 answer)
Exception in thread "main" java.lang.IllegalStateException: The driver executable does not exist while running Selenium Test on Ubuntu
(1 answer)
java.lang.IllegalStateException: The driver executable does not exist: while trying to execute tests through Selenium, ChromeDriver and Chrome
(4 answers)
Closed 2 years ago.
So i set up some web testing, it runs locally fine, but after I deployed this on a pipeline on the devops Buddy I get following error while it runs my tests:
Java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html
I guess I need to add some variables for the server to find/have the chromedriver or is it something else I need to do/adress?
The thing is that chromedriver is not installed in the agent where you are trying to run the test script. Please download the chromedriver first and then add the chromedriver path in the environment variable. Otherwise you can use System.setProperty("webdriver.chrome.driver", ""); to set the chromedriver with the help of your test scripts.

Unable to load IE Browser in Cucumber ,Java Framework

Unable to load IE Browser in Cucumber ,Java Framework
Serenity Properties File
webdriver.driver=iexplorer
webdriver.ie.driver = C:/Selenium/IEDriverServer.exe
When Running the test getting Exception Stating Caused by:
java.lang.IllegalStateException: The path to the driver executable
must be set by the webdriver.ie.driver system property
You should set the path with
System.setProperty("webdriver.ie.driver", C:\Selenium\IEDriverServer.exe);

Unable to start operaBlink through selenium webdriver

I am trying to start opera(v 36.0) using selenium 2.53.0 and Opera chromium driver _win64 (0.2.2).
When I try to run sample code, an exception occurred and browser didn't started.
Sample code:
File pathToOpera = new File("E://operadriver.exe");
DesiredCapabilities cap = DesiredCapabilities.operaBlink();
cap.setCapability("webdriver.opera.driver",pathToOpera);
driver = new OperaDriver(cap);
I am getting error as
java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.opera.driver system property; for more information, see https://github.com/operasoftware/operachromiumdriver. The latest version can be downloaded from https://github.com/operasoftware/operachromiumdriver/releases
at com.google.common.base.Preconditions.checkState(Preconditions.java:199)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:109)
at org.openqa.selenium.opera.OperaDriverService.access$0(OperaDriverService.java:1)
at org.openqa.selenium.opera.OperaDriverService$Builder.findDefaultExecutable(OperaDriverService.java:118)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296)
at org.openqa.selenium.opera.OperaDriverService.createDefaultService(OperaDriverService.java:82)
at org.openqa.selenium.opera.OperaDriver.<init>(OperaDriver.java:137)
My execution environment: win 8, 64 bit
Add before Your code:
System.setProperty("webdriver.opera.driver","E://operadriver.exe");
System.setProperty("opera.binary","E://yourOperaPath.exe");

Can not run tests using protractor on IE11

WebDriverError: The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. The latest versio
elenium-release.storage.googleapis.com/index.html
at WebDriverError (C:\Users\vivekb\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\error.js:27:10)
at Object.checkLegacyResponse (C:\Users\vivekb\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\error.js:580:13)
at C:\Users\vivekb\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:64:13
at Promise.invokeCallback_ (C:\Users\vivekb\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:1329:14)
at TaskQueue.execute_ (C:\Users\vivekb\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2790:14)
at TaskQueue.executeNext_ (C:\Users\vivekb\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2773:21)
at C:\Users\vivekb\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2652:27
at C:\Users\vivekb\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:639:7
at process._tickCallback (node.js:366:9)
getting some issue while running tests on IE.
In the server console i can see
16:47:34.080 WARN - Exception: The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. The latest version can be downloade
d from http://selenium-release.storage.googleapis.com/index.html
added property in config file. is the correct way to set it
seleniumArgs: ['-Dwebdriver.ie.driver=C:\\IEDriverServer.exe'],