I get the following error on selenium,
I don't know how to fix it or what I should do,
unknown error: unhandled inspector error: {"code":-32603,"message":"Cannot navigate to invalid URL"}
(Session info: chrome=29.0.1547.57)
(Driver info: chromedriver=2.2,platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 3 milliseconds
Build info: version: '2.35.0', revision: 'c916b9d', time: '2013-08-12 15:42:01'
System info: os.name: 'Windows Server 2008 R2', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_04'
Session ID: 6c0f76e6f67873a6318edab1d66e4ccf
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={chromedriverVersion=2.2}, rotatable=false, locationContextEnabled=true, version=29.0.1547.57, cssSelectorsEnabled=true, databaseEnabled=true, handlesAlerts=true, browserConnectionEnabled=false, nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=false, takesScreenshot=true}]
Command duration or timeout: 2.27 seconds
please help
I too got this error "org.openqa.selenium.WebDriverException: unknown error: unhandled inspector error: {"code":-32000,"message":"Cannot navigate to invalid URL"}"
To remove hardcoded URL and calling a URL from a file
I defined like this - ex: url="https://test.com" then I got the above error, after so many research and failures - simply I removed double quotes...it worked
ex: url=https://test.com
It happens if you´re using relative path to open the link. You can use absolute path (starting with http://) or - if it is an internal link/button on the web - you can mapp it as WebElement and perform click() method.
We managed to overcome the above error by changing the initialization Url. but now we are experiencing a bunch of new issues the latest chrome version, latest chromedriver and latest selenium versions.
Everything is extremely slow and we get many timeout since than.
Related
I am getting the below exception when i am trying to run my first test case using selenium webdriver in java. Can someone help me out plssss.....
Starting ChromeDriver 2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f) on port 48523
Only local connections are allowed.
log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Mar 29, 2018 7:34:16 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'
(Session info: chrome=65.0.3325.181)
(Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 6.3.9600 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 31 milliseconds
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'NIL-MKODAGA-D13', ip: '172.16.20.242', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '9.0.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome= {chromedriverVersion=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f), userDataDir=C:\Users\mkodagan\AppData\Local\Temp\scoped_dir4652_10811}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=65.0.3325.181, platform=WIN8_1, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, setWindowRect=true, unexpectedAlertBehaviour=}]
Session ID: 1a39885769cc96406e2f2732c361c049
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:671)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:272)
at org.openqa.selenium.remote.RemoteWebElement.sendKeys(RemoteWebElement.java:96)
at com.ham.scripts.ClickOnAllLinks.main(ClickOnAllLinks.java:44)
The error says it all :
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'
(Session info: chrome=65.0.3325.181)
(Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 6.3.9600 x86_64)
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'NIL-MKODAGA-D13', ip: '172.16.20.242', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '9.0.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver
The error clearly says that the Selenium Client and ChromeDriver is not getting detected back as in :
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Your main issue is the version compatibility between the binaries you are using as follows :
You are using chromedriver=2.33
Release Notes of chromedriver=2.33 clearly mentions the following :
Supports Chrome v60-62
You are using chrome=65.0
Release Notes of ChromeDriver v2.37 clearly mentions the following :
Supports Chrome v64-66
Your Selenium Client version is 3.4.0 of which is a bit older.
So there is a clear mismatch between the Selenium Client v3.4.0 , ChromeDriver version (v2.33) and the Chrome Browser version (v65.0)
Solution
Upgrade Selenium to current levels Version 3.11.0.
Upgrade ChromeDriver to current ChromeDriver v2.37 level.
Keep Chrome version at Chrome v65.x levels. (as per ChromeDriver v2.37 release notes)
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
Take a System Reboot.
Execute your #Test.
As mentioned by #DebanjanB, the problem lies with chromedriver version. From the logs you can see that it uses chromedriver=2.33.506120 which is bit old. Check for the latest version from "https://sites.google.com/a/chromium.org/chromedriver/downloads".
I was also facing the same problem the problem could be solved by updating the chrome driver.
You could uses below approaches for solving it.
Running npm install -g chromedriver
Manually updating the chromedriver, I found the chromedriver being used by the appium resides in below location.
C:\Users\User-Name\AppData\Local\appium-desktop\app-1.5.0\resources\app\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win.
Replace this chromedriver with the latest one and run your code. It should work fine.
Note: The location could be OS specific, so search for chromedriver exact location.
I am new to Selenium and need some trail to find root cause of the below error.
Selenium version - 3.5.3
ChromeDriver version - 2.29.4
Chrome version - 63
org.openqa.selenium.WebDriverException: unknown error: cannot determine loading status
from unknown error: missing or invalid 'entry.level'
(Session info: chrome=63.0.3239.132)
(Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.5.3', revision: 'a88d25fe6b', time: '2017-08-29T12:42:44.417Z'
System info: host: 'BADRI-HP', ip: '---.---.-.---', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_131'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.29.461591 (62ebf098771772160f391d75e589dc567915b233), userDataDir=C:\Users\Badri\AppData\Local\Temp\scoped_dir45280_30736}, takesHeapSnapshot=true, pageLoadStrategy=normal, unhandledPromptBehavior=, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=63.0.3239.132, platform=XP, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, platformName=XP, cssSelectorsEnabled=true, unexpectedAlertBehaviour=}]
Session ID: 60b98ca106d00b50963c47e02276c40b
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167)
at org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:40)
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:82)
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:45)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:646)
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:370)
at naukri.ProfileUpdate.login(ProfileUpdate.java:19)
at testScripts.NewTest.f(NewTest.java:29)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
The error says it all :
org.openqa.selenium.WebDriverException: unknown error: cannot determine loading status
from unknown error: missing or invalid 'entry.level'
Your main issue is the version compatibility among the binaries you are using as follows :
You are using chromedriver=2.29.461591
Release Notes of chromedriver=2.29.461591 clearly mentions the following :
Supports Chrome v56-58
You are using chrome=63.x
Release Notes of ChromeDriver v2.34 clearly mentions the following :
Supports Chrome v61-63
Release Notes of ChromeDriver v2.35 clearly mentions the following :
Supports Chrome v62-64
You are using Selenium Version 3.5.3.
Your JDK version is 1.8.0_131.
So there is a clear mismatch between the chromedriver version (v2.29.4) [which supports Chrome v56-58] with the Chrome Browser version (v63.x) [supported by ChromeDriver v2.34 minimum]
Solution
Upgrade JDK to recent levels JDK Version 8 Update 151.
Upgrade Selenium to current levels Version 3.8.1.
Upgrade ChromeDriver to ChromeDriver v2.35 level.
Keep Chrome to Chrome v64.x levels. (as per ChromeDriver v2.35 release notes)
Execute your Test.
I fixed this issue after updating chrome driver to 2.38 with chrome version 65.
https://chromedriver.storage.googleapis.com/index.html?path=2.38/
It seems that the ChromeDriver need to be updated. For chrome=63.0.3239.132, you might want to use ChromeDriver v 2.35. You can download the same for your system from:
ChromeDriver v 2.35
Hope it helps.
In my case, it was happening intermittently especially when running in parallel mode. Reducing the thread count to 5 from default (10) fixed my problem.
In my case I was using
selenium-java
3.8.1
I need to update and used the latest version it got resolved
Updated to:
selenium-java
4.3.0
I'm a newbie with Selenium WebDriver. I found some sample code, and adapted it a little bit to get my own test program. I'm having trouble with it! Here's the program:
package test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class SeleniumTester {
public static void main(String[] args) {
try {
System.setProperty("webdriver.chrome.driver", "C:\\Program Files\\Selenium\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("http://www.oddsportal.com/");
driver.manage().window().maximize();
String str = driver.getCurrentUrl();
System.out.println("The current URL is " + str);
}
catch (Exception ex) {
System.out.println("Encountered exception in SeleniumTester.main() :");
System.out.println(ex.getMessage());
}
}
}
It compiles fine, and starts running, first outputting some diagnostics:
"Starting ChromeDriver (v2.9.248315) on port 11716
October 25, 2017 6:11:22 IP.
org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS"
But then, at the line "driver.get(...);" an exception occurs :
"Encountered exception in SeleniumTester.main() :
unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"8164.1","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=61.0.3163.100)
(Driver info: chromedriver=2.9.248315,platform=Windows NT 6.3 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T16:15:40.131Z'
System info: host: 'DESKTOP-47EFBCO', ip: '192.168.43.83', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_144'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, chrome={userDataDir=C:\Users\Ilkka\AppData\Local\Temp\scoped_dir12200_17489}, takesHeapSnapshot=true, databaseEnabled=false, handlesAlerts=true, version=61.0.3163.100, platform=XP, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, platformName=XP, cssSelectorsEnabled=true}]
Session ID: 31a4a5806225e18533805ed0fbbca392"
Something about invalid context. What does it mean? How to fix it? Should I perhaps use a different constructor to create the ChromeDriver? Ideas, anyone?
Most likely the issue is because of an older version of chromedriver. Download a newer version of chromedriver and try giving its path.
The browser version and driver version compatibility issues could cause this issue. The chromedriver page mentions the driver compatibility for browser version. For example, as of now, the page lists:
Latest Release: ChromeDriver 2.33
Supports Chrome v60-62
I have used 2.44 with an earlier version of Firefox - it was working fine.
FirefoxDriver ffd = new FirefoxDriver();
ffd.get("www.google.com");
Now, even this simple invocation throws an exception:
Exception in thread "main" org.openqa.selenium.WebDriverException: f.QueryInterface is not a function
Command duration or timeout: 190 milliseconds
Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50'
System info: host: 'Shivam-PC', ip: '192.168.0.107', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_31'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=38.0.1, platform=WINDOWS, nativeEvents=false, acceptSslCerts=true, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 19f3d00e-ad14-4fc8-9d29-cee47ae44186
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:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:304)
at sele.Sample.main(Sample.java:13)
Caused by: org.openqa.selenium.WebDriverException: f.QueryInterface is not a function
Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50'
System info: host: 'Shivam-PC', ip: '192.168.0.107', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_31'
Driver info: driver.version: unknown
at <anonymous class>.FirefoxDriver.prototype.get(file:///C:/Users/Shivam/AppData/Local/Temp/anonymous4862788616202211612webdriver-profile/extensions/fxdriver#googlecode.com/components/driver-component.js:10132)
at <anonymous class>.DelayedCommand.prototype.executeInternal_/h(file:///C:/Users/Shivam/AppData/Local/Temp/anonymous4862788616202211612webdriver-profile/extensions/fxdriver#googlecode.com/components/command-processor.js:12274)
at <anonymous class>.DelayedCommand.prototype.executeInternal_(file:///C:/Users/Shivam/AppData/Local/Temp/anonymous4862788616202211612webdriver-profile/extensions/fxdriver#googlecode.com/components/command-processor.js:12279)
at <anonymous class>.DelayedCommand.prototype.execute/<(file:///C:/Users/Shivam/AppData/Local/Temp/anonymous4862788616202211612webdriver-profile/extensions/fxdriver#googlecode.com/components/command-processor.js:12221)
It seems to be common problem from version to version (I faced such kind of problem with FF v.36). Main work around is DO NOT update FF to the newest version (or downgrade if the worst already happened). If your tests work well with particular FF version -> stick with it at least till new version of WebDriver is released.
For myself the most reliable version is FF v.33.
It seems to me that the most robust solution for dealing with Selenium tests on Firefox is to stick with the latest ESR (Extended Support Release) which is mentioned in their CHANGELOG file. The Selenium team has to keep up with the changes introduced in Firefox and that may naturally lead to problems with the most recent versions here and there - not much has changed since the Selenium RC days in this respect.
Update 2016-01-18: There are now two ESR releases mentioned in the CHANGELOG, since with Firefox 33, support for native events has been dropped in favor of synthetic events. The wiki states:
Native events simulate the user interactions better whereas synthetic
events are platform independent, which can be important in Linux when
alternative window managers are used, see native events on Linux.
Native events should be used whenever it is possible.
So depending on your OS, you might try both versions to find the one better suited for you:
For native events: Firefox 31.7.0ESR
For synthetic events: Firefox 38.5.2ESR
Last mention was in Selenium 2.47.0 and included Firefox versions 31, 38 and 39.
If you want to use the latest ESR release no matter what, Mozilla provides a link for that, too.
It is due to your url...change it to http://www.google.com or https://www.google.com
Hope this fixes your problem...Kindly get back if you have any queries
I am trying to execute some test cases using chrome driver but out of 4 test cases only 1 is getting executed and for rest of the three i am getting SessionNotFoundException. I searched for the similar question on the portal but all of them are related to Internet Explorer but i am running my test on chrome driver.
Selenium version- 2.42.2
Exception in thread "main" org.openqa.selenium.remote.SessionNotFoundException: no such session
(Driver info: chromedriver=2.9.248315,platform=Windows NT 6.1 SP1 x86) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 128 milliseconds
Build info: version: '2.42.2', revision: '6a6995d', time: '2014-06-03 17:42:30'
System info: host: 'Admin-PC', ip: '10.0.0.6', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_31'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, chrome= {userDataDir=C:\Users\Admin\AppData\Local\Temp\scoped_dir4568_27180}, takesHeapSnapshot=true, databaseEnabled=false, handlesAlerts=true, version=41.0.2272.76, platform=XP, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 0fcb3e702dd1c8a23261b902625df216
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:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:162)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:614)
at org.openqa.selenium.remote.RemoteWebDriver.close(RemoteWebDriver.java:463)
at ResumeUpdate.Screen_1_Monster.operation(Screen_1_Monster.java:224)
at ResumeUpdate.Screen_1_Monster.main(Screen_1_Monster.java:341)
I changed some of the xpath and now the program won't throw any exception. I really not able to undertand that if the xpath was wrong then i should have recived NoSuchElementException instead of SessionNotFoundException. I tried to find an answer about why i am getting a wrong exception but till now not able to get a clear answer. Anyone who know about it please share the information
I also faced this problem recently and in my case browser was closing before test can run. e.g.
...........
"Login page" - {
"should have title" in {
pageTitle should be ("Login")
}
close()
}
..........
Replaced with
...........
"Login page" - {
"should have title" in {
pageTitle should be ("Login")
close()
}
}
..........
And fixed the issue.
If the Appium does not receive next command within 60 seconds it shuts down.
[BaseDriver] Shutting down because we waited 60 seconds for a command
[debug] [AndroidDriver] Shutting down Android driver
In my case, my automation was in a loop for more than 60 secs, for the app to finish it's task, which had network dependency.
You can avoid this by adding 'newCommandTimeout' to the capabilities, to increase timeout duration, like so:
capabilities.setCapability("newCommandTimeout", 90); //or seconds
Or you can add try / catch and log more meaningful message.