My team is using Jenkins for running test suits and getting report. Our regression test suit runs well on local machines while running the same test on Jenkins throws several errors, most of which, nearly 99%, is about selenium unable to locate element.
What would be cause of the issue?
org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"css selector","selector":"[data-testid='regular-shipment-form-step-shipment-scale-button-proceed']"}
(Session info: chrome=80.0.3987.106)
(Driver info: chromedriver=2.36.540471 (9c759b81a907e70363c6312294d30b6ccccc2752),platform=Linux 4.15.0-1077-azure x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
I have upgraded to Protractor 6.0.0 and Jasmine 3.3.1, and had to redo all my tests to run asynchronously.
When my Protractor test finishes running, I have an unexplained error at the end. No tests fail, but the process seems to abort irregularly. I am running against Chrome 73 in the latest webdriver, where I had to specifically downgrade to Chrome 73 webdriver because 74 is still in Beta.
Here is a snapshot of a test run:
Test suite 1 Tests
√ should check first thing
√ should check second thing
√ should display another thing
Executed 3 of 94 specs INCOMPLETE (89 SKIPPED).
C:\Users\Joon\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:3190
throw arguments[0];
^
NoSuchSessionError: invalid session id (Driver info:
chromedriver=73.0.3683.68
(47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT
10.0.17134 x86_64)
at Object.checkLegacyResponse (C:\Users\Joon\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:585:15)
at parseHttpResponse (C:\Users\Joon\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:533:13)
at Executor.execute (C:\Users\Joon\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:468:26)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
There is no additional error message, the only other SO post I found that had the same error message also had an additional promise rejected error afterwards.
How can I debug / troubleshoot what is causing this error?
I figured it out - there were some calls to browser.wait that did not have an await before them.
One of these was causing a synchronization error which led to that unspecified state management error at the end of the test run.
For anyone else experiencing WebDriver state errors after you upgrade from the control flow to the async flow - be sure to put await calls in front of all Protractor browser interaction calls. The one I had missed was browser.wait but it could be any other call to Protractor that causes this issue
I was able to run robot framework tests on Google Chrome using RIDE without issue. However just today I tried to run tests that had run properly before and now I'm getting the following error:
Starting test: Bbh-Robot.Test Cases.Search.Search 01 - Basics.Search for Toronto
20161108 13:48:44.163 : INFO : Opening browser 'googlechrome' to base url 'https://www.google.com/'
20161108 13:48:50.591 : FAIL : No browser is open
20161108 13:48:50.592 : WARN : Keyword 'Capture Page Screenshot' could not be run on failure: No browser is open
20161108 13:48:50.596 : FAIL :
WebDriverException: Message: session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"7332.1","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=54.0.2840.87)
(Driver info: chromedriver=2.22.397933 (1cab651507b88dec79b2b2a22d1943c01833cc1b),platform=Windows NT 6.1.7601 SP1 x86_64)
Ending test: Bbh-Robot.Test Cases.Search.Search 01 - Basics.Search for Toronto
I thought it might be an issue with chromedriver so I updated to the most recent version (and made sure the executable was included in my Path variable)
https://chromedriver.storage.googleapis.com/index.html?path=2.25/
But it still thinks I'm using 2.22 for some reason and I'm not sure where to proceed. Is there something I can do with RIDE specifically?
There is nothing you could do with RIDE (other than a clean restart).
This is a problem with PATH setting that somehow is finding first the old version of chromedriver.
(There could be also a running instance of the old chromedriver.)
I'm trying to run some Selenium tests using the ChromeDriver, and I started getting this error:
Starting ChromeDriver 2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129) on port 42985
Only local connections are allowed.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"7576.1","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=54.0.2840.59)
(Driver info: chromedriver=2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129),platform=Windows NT 10.0.14393 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 2.48 seconds
Build info: version: 'unknown', revision: '2aa21c1', time: '2016-08-02 14:59:43 -0700'
System info: host: 'SUJITH', ip: '192.168.43.228', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_101'
Driver info: org.openqa.selenium.chrome.ChromeDriver
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:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:683)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:247)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:130)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:143)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:170)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:159)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:116)
at Selenium.Test2.main(Test2.java:15)
Why is this happening, and how can I fix it?
Update your chromedriver with lastest version. And please clarify your question.
https://chromedriver.storage.googleapis.com/index.html?path=2.24/
If your chrome browser is recently updated to V54.0.x, then you might get this error. The solution for this problem is simply to update your chrome driver.
Choose chrome driver from the below link that will suit your system architecture.
Latest Chromedriver v2.25
This issue started showing up after chrome Version 54.0.x updates.
Remove the older chromedriver from your path and update your chromedriver to 2.24. This should resolve your issue.
I had the same issue . Updating the chrome driver solved my problem.
A few things to bare in mind for these type of cases:
Disable browsers auto update - at least on your slaves to avoid these type of breaking your CI process. Link for how to on Chrome, and be sure to watch these settings on the installation.
Versioning is the first thing to check with Selenium when it breaks all of a sudden. See notes for version compatibility.
I'm using my own Maven plugin to check compatibility between chromedriver and Chrome version
Hope it helps...
You might be using the lower version of the chrome driver.
org.openqa.selenium.SessionNotCreatedException: session not created exception
I had the similar issue and was getting the exception as above. So always check the latest version of driver from here: https://sites.google.com/a/chromium.org/chromedriver/downloads
You might need to set in /etc/hosts
127.0.0.1 localhost
In my case the problem was that I kept a Selenium script running for too much time than I run out of disk free space.
So, I just clean out the Temp folder and created a routine to keep cleaning selenium folders, and problem solved.
You will get this error when your code looks like below:
WebDriver driver = new ChromeDriver();
System.setProperty("webdriver.chrome.driver", "C:\\driver\\chromedriver.exe");
You have to setProperty first and then create driver instance next
System.setProperty("webdriver.chrome.driver", "C:\\driver\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
I have setup protractor-perf tests following the post by Parshuram.
However, when I run the tests using protractor-perf command, I get the following error:
Driver info: driver.version: unknown[0m
Stacktrace:
Error: [execute("(function(){var getTimeMs=(function(){if(window.performance)\nreturn(performance.now||performance.mozNow||performance.msNow||performance.oNow||performance.webkitNow).bind(window.performance);else\nreturn function(){return new Date().getTime();};})();var requestAnimationFrame=(function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){window.setTimeout(callback,1000/60);};})().bind(window);window.__RafRecorder={frames:[],flush:true,record:function(timeStamp){if(__RafRecorder.flush){__RafRecorder.frames=[];__RafRecorder.flush=false;}\n__RafRecorder.frames.push(timeStamp);requestAnimationFrame(__RafRecorder.record);},get:function(){__RafRecorder.flush=true;return __RafRecorder.frames;}};requestAnimationFrame(window.__RafRecorder.record);}());")] Error response status: 13, , UnknownError - An unknown server-side error occurred while processing the command. Selenium error: Build info: version: '2.42.2', revision: '6a6995d', time: '2014-06-03 17:42:03'
Info: Tests are run on chrome driver.
Please see if someone can help! Please let me know if more information is required.
PS: If I run the same test with protractor conf.js command, everything works fine. So, seemingly there is some issue with the protractor-perf setup OR I am missing some step somewhere!
The issue is resolved by starting the selenium webdriver. Earlier my tests were using Chromedriver directly and thus the issue.