I am using google chrome driver to automate using selenium. Chrome window always gets crashed in middle of execution when I try to navigate to some other URL. Please note that I get this error only when I try to navigate to same url for the 15th times i.e it works fine till 14th. I am done with upgrading/degrading chrome web driver.
Details:
os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_171'
ChromeDriver 2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb) on port 9319
Update: Guys, I do not get same issue when I create separate instance of chrome driver for each time when I navigate to URL.
Related
After starting a chrome driver in java a SessionNotCreatedException is thrown by the application.
This is the code:
System.setProperty("webdriver.chrome.driver", "D:\\Development\\Driver\\chromedriver.exe");
WebDriver webDriver = new ChromeDriver();
webDriver.get("https://google.com");
The exception:
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '4.0.0-beta-1', revision: '9c03156c2b'
System info: host: 'DESKTOP-S9O6TAK', ip: '192.168.0.211', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_261'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {desiredCapabilities=Capabilities {browserName: chrome}}]
Capabilities {}
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:635)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:252)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:174)
at org.openqa.selenium.chromium.ChromiumDriver.(ChromiumDriver.java:82)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:99)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:86)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:41)
at de.antonbowe.fachecker.FAChecker.(FAChecker.java:57)
at de.antonbowe.fachecker.FAChecker.main(FAChecker.java:63)
Caused by: java.lang.NullPointerException
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:122)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:153)
at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:153)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:128)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:620)
... 8 more
Process finished with exit code 1
I updated the chrome driver several times and tried other old projects. All dont work.
When I was using selenium-java version 4.0.0-beta-3 alone, it worked fine. But after I added the following additional dependencies to my project (per https://developers.google.com/gmail/api/quickstart/java), I got the same errors.
google-api-client 1.23.0
google-oauth-client-jetty 1.23.0
google-api-services-gmail v1-rev83-1.23.0
I downgraded my selenium-java to version 3.141.59. The error went away.
I'm using Selenium Web driver, however, I am preloading a browser by setting the debuggerAddress. I connect through a specified port. I had this working great. Suddenly, it's stopped working. I'm not quite sure what the issue is.
public void launchBrowser() throws InterruptedException {
try {
// Set file path of chrome driver
System.setProperty("webdriver.chrome.driver", "C:\\chromedriver.exe");
// Start chrome driver with existing chrome browser
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("debuggerAddress","localhost:1250");
// Create object
driver = new ChromeDriver(options);
// Write to console where we are
System.out.println(driver.getCurrentUrl());
}
catch(Exception e) {
console("JacksClass.java","launchBrowser()", "Exception: " + e);
}
}
Before I run the script. I start the Chrome browser with this command in CMD
start chrome --remote-debugging-port=1250
After launching the browser from CMD successfully. Then running the code. I get the following exception after around 1-2 minutes.
JacksClass.java - launchBrowser() : Exception: org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '4.0.0-alpha-6', revision: '5f43a29cfc'
System info: host: 'DESKTOP-5H32IOI', ip: '192.168.1.53', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '11.0.8'
Driver info: driver.version: ChromeDriver
All of this was working great a month ago. I have the chrome driver installed in the same location.
Finally got it to work. Firstly I tried to access the open port in another browser.
Typing localhost:1250 into the URL bar.
It could not connect. So there clearly was an issue with that port. I have tried many different ports but still had the same issue.
I finally tried port 1258 and then double-checked it with the test outlined above. Typing localhost:1258 into another browser proved the port was active.
Then my program worked as well! How strange! Glad it's working now :)
I have an issue with Edge browser below is my code.The browser opens but control never goes to the browser instead execution halts and shows the error
service = new EdgeDriverService.Builder()
.usingDriverExecutable(new File("C:\\Program Files (x86)\\Microsoft Web Driver\\MicrosoftWebDriver.exe"))
.usingAnyFreePort()
.build();
service.start();
driver = new EdgeDriver(service, DesiredCapabilities.edge());
driver.get("http://xyz.in");
On executing the line driver = new EdgeDriver(service, DesiredCapabilities.edge()); edge browser is getting launched after that execution is failing with the error as
'FAILED: test
org.openqa.selenium.remote.SessionNotFoundException: null (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.98 seconds
Build info: version: '2.48.2', revision: '41bccdd', time: '2015-10-09 19:55:52'
System info: host: 'ODERWin10', ip: '192.168.1.119', os.name: 'Windows 8', os.arch: 'x86', os.version: '6.2', java.version: '1.7.0_13'
Driver info: org.openqa.selenium.edge.EdgeDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:164)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:647)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:247)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:129)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:142)
at org.openqa.selenium.edge.EdgeDriver.<init>(EdgeDriver.java:152)
at Pack1.CrossBrowserTest.test(CrossBrowserTest.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)'
Please suggest a solution, thanks in advance
Selenium 2.48.2 recognizes Windows 10 as Windows 8, i get the same error. The only way I've been able to get Edge to open and not hang is to manually open the MicrosoftWebDriver.exe file, and input whatever URL it tells me it's listening on:
DesiredCapabilities browser = DesiredCapabilities.edge();
browser.setBrowserName(DesiredCapabilities.edge().getBrowserName());
WebDriver driver = new RemoteWebDriver(new URL("http://localhost:17556"), browser);
I had the same problem with SessionNotFoundException
Be sure to use the latest WebDriver for Windows Insiders from here https://www.microsoft.com/en-us/download/details.aspx?id=48740 (the normal one from here https://www.microsoft.com/en-us/download/confirmation.aspx?id=48212 does not work anymore on newer Windows 10 builds than 10240)
The 'Windows 8' display problem is as far as I know only a wrong output and not the root of the issue. Nonetheless it is fixed in selenium 2.49.0 (it's bug #669)
The problem is that you are trying to use Edge on a system in which it is not installed.
As told here :
System info: host: 'ODERWin10', ip: '192.168.1.119', os.name: 'Windows 8', os.arch: 'x86', os.version: '6.2', java.version: '1.7.0_13'
You are on Windows 8.
Edge is only supported and available on Windows 10.
You need to use a Windows 10 machine to run you test.
How to run selenium test scripts in android browser
I am getting an error message stating
org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. Build info: version: '2.32.0', revision: '6c40c18', time: '2013-04-09 17:22:56'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_07'
as a prerequisites, I have successfully installed webDriver APK
adb -s 4df7e035582e21e3 forward tcp:8080 tcp:8080
but while running my test scripts it throws the above mentioned error "Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure"
Can any one help me out
Please
Thanks
I'm using Arquillian Graphene with Selenium 2.
The trouble is coming from the Graphene.guardNoRequest(); method.
The error thrown is :
java.lang.RuntimeException: org.openqa.selenium.WebDriverException:
Can't execute JavaScript before a page has been loaded!
Build info: version: '2.25.0', revision: '17482', time: '2012-07-18 22:18:01'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_43'
I've also tried to get elements to assert that they exist, i've catched the page source and everything seems to be ok. I've tried to put a wait like
wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("selector here")));
Someone has/had the same struggle?
UPDATE : Problem solved
I've solved this problem, but i need some time to make a clear explain about what happens and what's my solution