I run tests on my locale machine (not in grid), and it works. However, when I run on Jenkins, on Linux server in selenium grid, I have strange error:
net.serenitybdd.core.exceptions.SerenityManagedException: The following error occurred: Expected condition failed: waiting for core.common.utils.WebDriverUtil$$Lambda$195/1333459330#4f5c82fa (tried for 30 second(s) with 500 MILLISECONDS interval)
Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T18:33:54.468Z'
System info: host: 'fr-woqa01', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.16.0-4-amd64', java.version: '1.8.0_131'
Driver info: net.thucydides.core.webdriver.WebDriverFacade
at net.serenitybdd.core.exceptions.SerenityManagedException.detachedCopyOf(SerenityManagedException.java:21)
at net.thucydides.core.steps.StepInterceptor.runTestStep(StepInterceptor.java:419)
at net.thucydides.core.steps.StepInterceptor.runOrSkipMethod(StepInterceptor.java:151)
at net.thucydides.core.steps.StepInterceptor.testStepResult(StepInterceptor.java:138)
at net.thucydides.core.steps.StepInterceptor.intercept(StepInterceptor.java:69)
at serenity.steps.HomePageSteps$$EnhancerByCGLIB$$c60d4147.openPage()
at jbehave.scenariosteps.LoginPageScenario.navigateToPage(LoginPageScenario.java:26)
(reflection-invoke)
at org.jbehave.core.steps.StepCreator$ParametrisedStep.perform(StepCreator.java:733)
at org.jbehave.core.embedder.PerformableTree$FineSoFar.run(PerformableTree.java:346)
I run test using command:
-pl ui verify -Dstory.file.name=${story_name} -Denv.config.file=qa.properties -Dwebdriver.remote.url=http://localhost:4444/wd/hub -Dwebdriver.remote.driver=chrome -Dwebdriver.remote.os=LINUX -Dchrome.switches="--no-sandbox,--ignore-certificate-errors,--homepage=about:blank,--no-first-run, --disable-gpu, --disable-impl-side-painting, --disable-gpu-sandbox, --disable-accelerated-2d-canvas, --disable-accelerated-jpeg-decoding, --test-type=ui"
Any help?
The error tells serenity cannot talk to webdriver. Which could be either due to chromedriver not avaliable on the jenkins slave/jenkins machine or chrome itself not installed on the jenkins machine.
Run these commands on to check if chrome /chrome driver is installed on jenkins machine
which chromedriver
which google-chrome
Related
I know it works fine when I run in headless mode.
However is it possible to run in non-headless mode?
I've installed xvfb through docker and setting
ENV DISPLAY=:99
While running the test
docker run -e Xvfb ${DISPLAY} gradle <task name>
It always gives the error as
org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: '4c3a51d1d7', ip: '<ip>', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.87-linuxkit-aufs', java.version: '1.8.0_222'
I am trying to start a selenium test with the following command
selenium-side-runner --server http://127.0.0.1:4444/wd/hub --debug -c
"browserName='firefox' moz:firefoxOptions.args=[-profile, /home/seluser.
/firefox-profile/myprofile]" --output-directory ~/out ~/portallogin.side
The profile is loaded correctly in firefox then but the test fails to run with the following exception:
Test suite failed to run
WebDriverError: connection refused
Build info: version: '3.141.59', revision: '82b03c358b', time: '2019-04-30T22:04:50'
System info: host: 'd871aae50a23', ip: '172.17.0.3', os.name: 'Linux', os.arch:
'amd64', os.version: '4.4.0-1075-aws', java.version: '1.8.0_212'
Driver info: driver.version: unknown
remote stacktrace:
at Object.checkLegacyResponse (../../../usr/lib/node_modules/
selenium-side-runner/node_modules/selenium-webdriver/lib/error.js:585:15)
at parseHttpResponse (../../../usr/lib/node_modules/
selenium-side-runner/node_modules/selenium-webdriver/lib/http.js:551:13)
at Executor.execute (../../../usr/lib/node_modules/
selenium-side-runner/node_modules/selenium-webdriver/lib/http.js:486:26)
While running the same test without the profile beeing loaded is working.
I have found this issue: https://github.com/SeleniumHQ/selenium-ide/issues/616 and it looks like a bug.
I tried to add a .side.yml file but that didn't help yet.
It looks like the loading of a profile is disabling the webdriver functionallity in firefox. Any hints how to get it running?
There is a workaround provided here https://github.com/mozilla/geckodriver/issues/1058#issuecomment-350254437
We need to pass the --marionette-port 2828 during the selenium execution.
I'm new to Selenium Grid and I'm trying to execute a protractor test on a remote node.
I'm using a Virtual Machine as Hub, the Node is my local machine which is also the client.
Both hub and node are up and running.
I've set the property seleniumAddress correctly in the conf.js file.
So now when I execute my test by running protractor conf.js, I'm getting this error:
E/launcher - SessionNotCreatedError: Unable to create new service:
ChromeDriverService
Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-
08T15:15:08.936Z'
System info: host: 'host-name', ip: 'ip-address', os.name: 'Windows 7',
os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_171'
Driver info: driver.version: unknown
at Object.checkLegacyResponse
I have no idea why I'm getting this error. I tried to fix it by running:
webdriver-manager clean
webdriver-manager update
but it didn't help.
I solved this problem by specifying the location of the chromedriver executable using the argument Dwebdriver.chrome.driver. This argument should be set when starting the node.
chromedriver documentation
Protractor version: 5.1.2
Safari version: 10.1.2
I have enabled 'Allow Remote Automation' from Safari -> Develop and started the safari driver from cmd using the following command:
/usr/bin/safaridriver -p 8844
Now, trying to run the protractor tests using protractor conf.js. The tests fail to start with the following logs:
Build info: version: '3.5.1', revision: '9c21bb67ef', time: '2017-08-16T21:10:06.092Z'
System info: host: 'dyn-49-127-9-116.its.monash.edu.au', ip: 'fe80:0:0:0:479:1a15:751b:51d6%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_144'
Driver info: driver.version: unknown
[15:28:40] E/launcher - SessionNotCreatedError: Could not create a session: You must enable the 'Allow Remote Automation' option in Safari's Develop menu to control Safari via WebDriver. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 32 milliseconds
Build info: version: '3.5.1', revision: '9c21bb67ef', time: '2017-08-16T21:10:06.092Z'
System info: host: 'dyn-49-127-9-116.its.monash.edu.au', ip: 'fe80:0:0:0:479:1a15:751b:51d6%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_144'
Driver info: driver.version: unknown
at WebDriverError (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:27:5)
at SessionNotCreatedError (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:214:5)
at Object.checkLegacyResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:505:15)
at parseHttpResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:509:13)
at doSend.then.response (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:440:13)
at process._tickCallback (internal/process/next_tick.js:109:7)
From: Task: WebDriver.createSession()
at Function.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:777:24)
at createDriver (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:167:33)
at Builder.build (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:632:14)
at Hosted.getNewDriver (/usr/local/lib/node_modules/protractor/lib/driverProviders/driverProvider.ts:60:29)
at Runner.createBrowser (/usr/local/lib/node_modules/protractor/lib/runner.ts:225:39)
at q.then.then (/usr/local/lib/node_modules/protractor/lib/runner.ts:391:27)
at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:796:13)
at /usr/local/lib/node_modules/protractor/node_modules/q/q.js:556:49
[15:28:40] E/launcher - Process exited with error code 19
I figured out the issue. Since built in safari driver has a limitation of only one browser window at a time, I quit all the running safari windows and ran the tests again. Worked perfectly fine :)
Reference:
https://webkit.org/blog/6900/webdriver-support-in-safari-10/
Kinda tricky, because currently it's not quite working due webdriver/selenium incompatibilities. We are hoping that, with the new webdriver release, it will work. See here.
I don't know if this is a Protractor or PhantomJS error.
I'm running this command, getting this log.
It seems like PhanthomJS or Selenium Standalone is dying after the fist fail test.
Do you need more logs/details to check where is the issue?
$ grunt accept:standalone --suite=list
Running "env:rde" (env) task
Running "shell:protractor_update" (shell) task
selenium standalone is up to date.
chromedriver is up to date.
Running "protractor_webdriver:start" (protractor_webdriver) task
Starting Selenium server
Started Selenium server: http://127.0.0.1:4444
Running "protractor:test" (protractor) task
Using the selenium server at https://localhost:4444/wd/hub
[launcher] Running 1 instances of WebDriver
Session created: loggingPrefs=org.openqa.selenium.logging.LoggingPreferences#255d17d7, count=1, browserName=phantomjs, phantomjs.binary.path=c:\git\clients\special-offers\node_modules\phantomjs\lib\phantom\phantomjs.exe, version=ANY
Preparing new session
.FF
Failures:
1) Special Offers list page should have a thumbnail, a title, a description and a CTA
Message:
NoSuchElementError: No element found using locator: By.cssSelector(".ss .details p.body-copy")
2) sssssssssssssss
Message:
UnknownError: Error communicating with the remote browser. It may have died.
Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50'
System info: host: 'CBA-D013', ip: 'xxxxxx', os.name: 'Windows NT (unknown)', os.arch: 'amd64', os.version: '6.2', java.version: '1.6.0_26'
Driver info: driver.version: EventFiringWebDriver
Finished in 29.282 seconds
3 tests, 6 assertions, 2 failures
Session deleted: Keeping the Selenium server alive
c:\git\clients\special-offers\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:113
var template = new Error(this.message);
^
>>
>> Test failed but keep the grunt process alive.
Running "shell:kill_selenium" (shell) task
Shutting down Selenium server: http://127.0.0.1:4444
Done, without errors.
Bye all!