I have an existing suite of karate tests which can run on different environments (dev / qa) using the approach below:
mvn test -DargLine="-DauthUser=*** -DauthPassword=*** -Dkarate.env=qa"
Now i have added some gatling tests and when try to run the tests on 'qa' with the following command, the tests still run on my default environment which is 'dev' instead of 'qa'.
mvn gatling:test -DargLine="-DauthUser=*** -DauthPassword=*** -Dkarate.env=qa"
Seems like the argLine approach will not work with maven gatling plugin. If not, is there any other way of passing these arguments for gatling tests?
I came across previous post where its suggested to not use -DargLine when specifying arguments - I want to pass multiple arguments in karate-config.js through mvn command
Just pass the command line arguments like:
mvn gatling:test -DauthUser=*** -DauthPassword=*** -Dkarate.env=qa
Related
I am looking to pass data provider thread count value from command line an then pick this parameter in build.gradle and use it inside useTestNg() inside the test task. Is this possible?
For example:
Command: gradle clean build test -Pdataproviderthreadcount=5
Can this be captured using systemPropeties and the value to be used in useTestNg()
Since dataproviderthreadcount is a VM option, I used this as below and it worked as expected. My project is a Cucumber, Gradle and testNG.
TEST_ENV=STG BROWSER=chrome ./gradlew clean build -Dorg.gradle.jvmargs=-Ddataproviderthreadcount=2
You can also refer How can I pass VM arguments to gradle from command line?
I have a .side file generated by the Selenium IDE, which I need to run on CI using Jenkins.
I am running it as a build step with the following shell command:
selenium-side-runner /path/to/file.ide
The problem arises due to the fact that no matter if the selenium test fails, Jenkins always shows is as success.
In this thread it's suggested to upload the file as generic, but still, the commands to execute it are missing
How to upload a generic file into a Jenkins job?
I've found a possible solution to it on this posts, but I would appreciate having a cleaner way to solve this instead of parsing the results checking for errors.
How to mark a build unstable in Jenkins when running shell scripts
Is there a plugin able to run selenium .side files on Jenkins and this one showing the success/failures of the test?
You can generate a Junit test report file and then use the Jenkins Junit plugin after your tests execution.
selenium-side-runner --output-directory=results --output-format=junit
# Outputs results in `junit` frormat in `./results/projectName.xml'
Check the official documentation for more details.
Is there a way to execute TestNG.xml in dry run mode so that I can figure out what methods gets qualified for the test run. I am using Eclipse and intend to run the tests via testng.xml. How to configure Run Configurations for this.
Newbie to Selenium-TestNG and Eclipse
I tried to provide -Dtestng.mode.dryrun=true in Run Configurations -> Arguments tab under both Program argument and VM arguments
The run configurations had no effect on the execution. The tests were executed in normal fashion. I expected the configurations would just list test methods in the console
You are going to see all tests with no failures. That what you expect when you run testNg with the argument.
To check the dryrun argument works, make your test to fail. Then run your test with "-Dtestng.mode.dryrun=true". Add the argument in "VM arguments"
Also, check your version of testNG is 6.14 or higher
I need to run python units test cases as part of bamboo build step and the build needs to fail if unit tests fail.
For this, I have a Script step in bamboo build and i am trying to run the following in it:
python -m unittest discover /test
Here, /test folder has all the unit tests.
The output of the above script it
Ran (0) tests
So the problem is that bamboo isn't able to discover these tests. Bamboo agent is linux.
Wondering if anyone has done such a thing before and has any suggestions.
The following worked. Used -p (pattern) attribute to discover/run the unit tests in bamboo (unix build agent)
python -m unittest discover -s test -p "T*.py"
Note: 1. all my test cases start with "T" e.g. Test_check.py
2. "test" is the package where all my test cases are.
If you haven't figured it out, likely because in windows filenames aren't case sensitive but in Linux they are...
And you're test file named Test_xxxx.py isn't the same as test_xxxx.py which is the pattern that discovery is trying to use...
How do I explicitly say with my go test command to run only tests for the main package and not others in my source directory.
At the moment it's working with $go test -v. But... I am using goconvey as well and it seems to be running recursively. According to this page https://github.com/smartystreets/goconvey/wiki/Profiles I have a file where I can pass arguments into the go test command. I know you can go test -v ./... for recursive or go test -c packagename/... but how do I just do it for the main?
Profiles is one to accomplish this, but you can also specify a 'depth' for the runner:
$ goconvey -depth=0
A value of 0 limits the runner to the working directory.
Run goconvey -help for details.