selenium-jupiter - Unable to find screenshot file - selenium-jupiter

When I tried to run the below command with JUnit 5
mvn clean install -DskipTests && mvn clean test -pl=test-insight -Dtest="com.myproject.automation.test.settings.**" -Dspring.profiles.active="live" -Dsel.jup.screenshot.at.the.end.of.tests=whenfailure -Dsel.jup.screenshot.format=png -Dsel.jup.output.folder=target/screenshot
After that, I couldn't see the screenshot is created. Does anyone help me with my problem?
Thank you

I believe you need to enable surfire-reports.

Related

Unable to make airflow run on Linux server

I installed airflow on linux server using: sudo pip3 install apache-airflow. It got installed successfully.
Then I did: export AIRFLOW_HOME=~/airflow. Finally I ran sudo airflow initdb, it's giving me an error:
sudo: airflow: command not found
echo $PATH prints something like this:
/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/xyz/abc/.local/bin:/home/xyz/abc/bin
I went through these posts:
Getting bash: airflow: command not found
How to install airflow?
But, couldn't find any solution that would solve my problem. Don't know what I'm missing. Any help regarding this would be appreciated..
It looks like the execution bit was not set for the airflow binary. Run sudo chmod 775 /usr/local/bin/airflow to fix this.

Passing multiple tags (or/and) via -Dcucumber.options does not trigger my test

i've bunch of scenarios with tagging #ABC and #DEF under module 'TEST'.
I'm able to run test with multiple tagging using following command (older way and soon to be deprecated)
mvn clean test -pl TEST -Dcucumber.options="--tags #ABC,#DEF"
but not
mvn clean test -pl TEST -Dcucumber.options="--tags '#ABC or #DEF'"
any idea?
i've also switching the quotes around but still doesn't work, no test are triggered.
what I've tried
-Dcucumber.options='--tags #ABC or #DEF' -Dcucumber.options='--tags "#ABC or #DEF"' -Dcucumber.options="--tags '#ABC or #DEF'" -Dcucumber.options="--tags '(#ABC or #DEF)'"
Thanks alot!
I don't think you need the single quotes. Could you try mvn clean test -pl TEST -Dcucumber.options="--tags #ABC or #DEF"?
Note, for more information, see Cucumber documentation on Tag expressions
In my environments (W10 and CentOS 7), the 3rd way that you listed is working for me.
-Dcucumber.options="--tags '#ABC or #DEF'"
My tests are their own module in our application project, so I execute a java class to run stuff (vs. maven test). For example on CentOS, I have a script with the line
java -ea -Dcucumber.options="${cucumberTags}" regressionTests.AutomatedTest >> $logFile.log
I kick off the tests using a script, and it can be a little tricky buliding the "cucumberTags" string, and getting a literal single quote before the first and after the last tag, but this is definitely my working format.
-Dennis

haxelib selfupdate won't work

Whenever I run haxelib selfupdate I get the following error:
Error writing file /usr/bin/haxelib. Please ensure you have write permissions.
[file_open,/usr/bin/haxelib]
I tried to change the owner and group of /usr /usr/bin and /usr/bin/haxelib to my own user and group to no use. I get the same error :/
If I try to run haxelib as administrator, it requires me to make a new haxelib setup (I guess it is one setup per user). Once I did the setup and ran sudo haxelib selfupdate I got the folloing error:
Error compiling haxelib client: Standard library not found
I tried to found more resources on how haxelib works and is organized to try to solve this issue but I couldn't. Could anyone explain me what I am missing? I know it is very silly but I can't get it to word.
Since commit the command haxelib selfupdate is deprecated and will be removed in future. There more changes.
Use haxelib --global update haxelib instead.

Jenkins build fails when running nodeJS

I have Jenkins set up on a machine with the NodeJS plugin. Sadly, whenever I try to use the plugin in a build, it fails with:
[workspace] $ node /tmp/hudson3477900862350780409.js
FATAL: command execution failed
java.io.IOException: Cannot run program "node" (in directory
"/var/lib/jenkins/jobs/XXX/workspace"): error=2, No such file or directory
When I log into the machine as the jenkins user, I can use node through command line. I also added the path to node (/opt/node-0.6.18/bin) into the Configuration screen for the current working node (which is only one: master).
I've been stuck with this for a while, any help would be highly appreciated.
Cheers!
Well, this isn't the most elegant of solutions, but it worked: I simply made a symlink to from /bin/ to the installation path for node and now the problem's gone.
ah easy, you need to tick "Provide Node/npm bin folder to PATH" when running a "execute shell" build task"
I am using NVM and I had the same issue. One workaround was to create a symlink:
ln -s /root/.nvm/versions/node/v8.11.3/bin/node /bin/node
ln -s /root/.nvm/versions/node/v8.11.3/bin/npm /bin/npm
For Jenkins running in Docker, use jenkins/jenkins:latest image to avoid this issue.
the error came up just because you did't install node in your machine.after you installed it,and add it to PATH,then the problem can be solved.
hope it helps.

unable to connect to chromedriver http://127.0.0.1:46050 (Selenium::WebDriver::Error::WebDriverError)

I get this error when I run my cucumber tests:
"*Unable to either launch or connect to Chrome. Please check that ChromeDriver is up-to-date. Using Chrome binary at: /opt/google/chrome/google-chrome (Selenium::WebDriver::Error::UnknownError)
*"
I downloaded the chromdriver, unzip it, copy it to the path (/opt/google/chrome/google-chrome ) and sudo chmod +x /opt/google/chrome/google-chrome.
which google-chrome : /usr/bin/google-chrome
which chromedriver : /usr/share/ruby-rvm/gems/ruby-1.9.2-p318/bin/chromedriver
capybara (1.1.2)
cucumber (0.9.4)
cucumber-rails (0.3.2)
selenium-webdriver (2.20.0)
I searched my error but none of the answers worked for me!
When I run my test I do not see chrome starts!
I really dont know what is wrong! I tried two different versions of chromedriver!
Jenkins should run/executes my tests in CI.The tests work when you run them but not when Jenkins runs them? I could run them by another user and then I installed jenkins and I get this error. I get the same error when I run my tests in terminal at terminal as well.Did you read https://wiki.jenkins-ci.org/display/JENKINS/My+software+builds+on+my+computer+but+not+on+Jenkins ? I couldnt find much about my problem here. xvfb: I installed the plugin in the jenkins but in the build environment if I click "run xvfb before the build and shut it down after", I get this error: "FATAL: null java.lang.NullPointerException"
Please provide more details. How does this question relate to Jenkins? Is Jenkins executing the tests? The tests work when you run them but not when Jenkins runs them? You do not go so far as to say that out loud, but I will assume it because it is what people usually need help with.
Did you read https://wiki.jenkins-ci.org/display/JENKINS/My+software+builds+on+my+computer+but+not+on+Jenkins ?
If you are executing Chrome inside a Jenkins job, do you have something like https://wiki.jenkins-ci.org/display/JENKINS/Xvfb+Plugin or https://wiki.jenkins-ci.org/display/JENKINS/Xvnc+Plugin installed?
chromedriver can be installed in two ways: downloading, decompressing the zip and putting the file in "/usr/bin" or adding the "chromedriver-helper" gem in your Gemfile.
Choose one or another way because doing both many time it causes problems. If you are installing chromedriver from google, be sure to uninstall the gem:
gem uninstall chromedriver-helper
and be sure chromedriver is in your path:
which chromedriver
Give this a try instead => https://github.com/flavorjones/chromedriver-helper
Finally I found the answer:
if you want to run GUI tests on Jenkins CI running on Windows do not
configure it as a windows service instead run it from the command
prompt or set it up as a scheduled task to run on windows logon using
the command “java -jar jenkins.war”
taken from this article

Resources