Playframework test-runner selenium permission denied Location.href and Command Execution Failure - permissions

This test works locally, but when run from the Play test runner on our aws ci instance, I get the following permissions error in Firefox: Permission denied for HOST to get property Location.href and then Command execution error.
In Chrome, the remote message is different, but I sense the same underlying reason. Object <> has no method 'getCurrentWindow'.
Is it this issue? http://code.google.com/p/selenium/issues/detail?id=703

you are using the Play standard test runner from a remote location, which is the source of the issue (as far as I know).
Try to use play auto-test as described here to run the tests.

Related

Unable to run testcafe tests on CI/CD gitlab but works fine locally on the runner

I am seeing an issue running testcafe tests on the gitlab runner. The tests runs fine locally on the gitlab runner, but when run off the CI/CD pipeline it fails. Below is my .yaml code -
test-e2e-windows:
stage: test
cache:
<<: *global_cache
policy: pull
#needs: ['yarn-install']
tags:
- win32
script:
- yarn install
- yarn run test:e2e
Below is the error I see -
$ yarn run test:e2e
Running tests in:
Chrome 99.0.4844.82 / Windows 10
Audio Configuration Combination
× Inbuilt_Mic_Recording_1Ch_48 khz_16 bit_64 kbps_opus_webm
A JavaScript error occurred on
"https://dolby-web-sdk-dev.net/sandbox/index.html".
Repeat test actions in the browser and check the console for errors.
To ignore client-side JavaScript errors, enable the
"--skip-js-errors" CLI option, or set the "skipJsErrors"
configuration file property to "true".
If the website only throws this error when you test it with
TestCafe, please create a new issue at:
"https://github.com/DevExpress/testcafe/issues/new?template=bug-report.md".
JavaScript error details:
NotFoundError: Requested device not found
No stack trace available
Am I missing something here?
According to the "Requested device not found" error message, this issue is related to your application implementation:
DOMException: Requested device not found GetUserMedia.
Requested device not found - Unable to access Camera and Microphone
I can assume that it tries to access some device on a virtual machine but fails due to the fact that this device does not exist. In my opinion, the best way to resolve this issue is to manually handle this error in your application.
If my assumptions are wrong, please create a new GitHub issue using this template and share a minimal working example illustrating the issue.

Selenium+Jenkins+Chromedriver = WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally

I have problem with running my Selenium tests in Jenkins.
A result of execution is always:
WebDriverException: Message: unknown error: Chrome failed to start:
exited abnormally
My tests are written in Robot Framework and are using Chromium webdriver.
I'm setting needed paths in my command, which looks like this:
export PATH=$PATH:/usr/lib/chromium-browser; export PATH=$PATH:/usr/lib/chromium-browser/chromedriver; . /home/michal/robot_env/bin/activate; robot -L TRACE /home/michal/project_robot/tests
And when I run this command manually in terminal IT WORKS fine (Chromium starts automatically and the test goes on).
So the problem suppose to be in Jenkins. I have installed Xvfb plugin, but it didn't help.
Additionally, in /etc/init.d/jenkins I put these lines:
/usr/bin/X :0 vt7 -ac
export DISPLAY=:0
xhost +
And once again - nothing changed. What else should I set or check?
i got stuck same way.
The problem is that jenkins has it own user, called jenkins, and jenkins user cannot open the browser.
if you try to make "su jenkins" and then "chromium-browser" you obtain the display error.
That because you obtain this issue. The problem is not the webdriver, the problem is the user.
i removed the jenkins user created by jenkins and i createad a normal user called jenkins before installing jenkins.
then i installed jenkins.
now jenkins user can run the test (because it can open the browser) but jenkins itself will not load anymore.

Unable to run a test from MTM - Config issue

I have set up a Test Controller and Test Agent running in separate machines and they are able to communicate with each other.
When I try to run the test from MTM (Selenium Tests), the test failed with the below error message
(QTController.exe, PID 1104, Thread 15) Could not use lab service account to access the build directory.
Failure: Network path does not exist or is not accesible using following user:
https://mydevelopment.visualstudio.com/defaultcollection/c2f372df-8c45-487a-9b51-4ced6e8f6037/_apis/build/builds/969/artifacts?artifactName=drop&%24format=zip
using MYDEV\timothy.alex. Error Code: 67
(QTController.exe, PID 1104, Thread 15) TcmRunner: Error starting the test run: The build directory of the test run either does not exist or access permission is required..
This clearly mentions that the error is because of access issue. But when I try downloading the build from the url mentioned in the error log using the same credentials mentioned in the ERROR log, I am able to download the drop zip file.
Is there any thing I am missing in the set up. Any help would be really really great.
It looks like you're using the new task-based build system. You can't run automated tests from a task-based build from MTM at present -- you have to use the older XAML build system for that.

Test Cases of Robot Framework are getting failed on server giving error "TypeError: get_request() got an unexpected keyword argument"

I have a project in Java and the test scripts are written in robot.
I want to run my test scripts on the server where I have a WAR file, (after building), of my project. When I am running my test scripts on the local system it working, but When I run my test scripts on server, some tests are getting passed and some are getting failed. My server is Ubuntu 14.04.
I am using the following command to run test scripts on server:
pybot -v env:dev /var/lib/jenkins/jobs/AnATest/tests/
where env:dev is just environment name and /var/lib/jenkins/jobs/AnATest/tests/
is my directory where all my robot tests files are residing.
Please tell me, if more information is required.
It sounds like you simply have a different version of a library on your server than on your local machine. The one on the server has a get request keyword that doesn't take the same arguments as the one on your local machine.

SeleniumException: ERROR: Command execution failure. Permission denied

SeleniumException: ERROR: Command execution failure. Please search the forum at http://clearspace.openqa.org for error details from the log window. The error message is: Permission denied.
Although my test runs perfectly in Firefox and also in IE when running in Debug mode, in IE in Run mode it fails with the error message above. selenium.waitForPageToLoad("20000"); doesn't seem to be a solution.
Any other ideas?
What command is failing with the Permission Denied? It may be when trying to access something that doesn't exist yet. I would recommend using the waitForCondition command to ensure the target element is present/visible before attempting to interact with it.
I used Thread.currentThread().sleep(1000); after the action that requires time to reload parts of the page. It seems to work, but not in all of the cases.