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.
Related
I'm running Selenium tests on CentOS 7 machine through Jenkins pipeline hence using Xvfb. When use screen argument with any valid value like following -
wrap([$class: 'Xvfb', autoDisplayName: true, screen: '1440x800x8']) {
<code to run Selenium test here>
}
It results into following error -
[testng] org.openqa.selenium.WebDriverException: chrome not reachable
[testng] (Session info: chrome=80.0.3987.132)
[testng] (Driver info: chromedriver=80.0.3987.16 (320f6526c1632ad4f205ebce69b99a062ed78647-refs/branch-heads/3987#{#185}),platform=Linux 3.10.0-862.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
[testng] Command duration or timeout: 0 milliseconds
[testng] Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:13:22.693Z'
If we run it without screen argument it runs successfully.
One more observation - with screen argument, it perfectly works on Ubuntu 18
Please help me how I can run Selenium tests with screen argument on CentOS 7.
After trying with different values for screen parameters, I realized this is not something which is wrong with Chrome browser or driver but with value passed to screen
When I changed depth value from 8 to 16, Selenium execution started successfully - screen: '1440x800x16'
wrap([$class: 'Xvfb', autoDisplayName: true, screen: '1440x800x16']) {
<code to run Selenium test here>
}
But technically, I did not understand why this error occurs and how depth value helped to resolve it.
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 have a test in specflow which when run in 'run test' mode works, but when run in 'debug' mode it fails.
The issue given is a selenium webdriver issue:
OpenQA.Selenium.WebDriverTimeoutException: Timed out after 60 seconds ---> OpenQA.Selenium.NoSuchElementException: no such element
(Session info: chrome=48.0.2564.97)
(Driver info: chromedriver=2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf),platform=Windows NT 6.1 SP1 x86_64)
Please advise what the issue might be.
Many Thanks,
Rahul Dixit
after a while this issue went away, dont know what was at the bottom of it. Thanks.