JMeter load testing with JUnit from Selenium IDE - junit

I have problem with JMeter not picking up my JUnit test.
What I did:
got JMeter and extracted
created JUnit test through Selenium IDE and exported as JUnit4(WebDriver)
try that test runs when executed (in IntelliJ)
created JAR of the class file
placed JAR into jmeter.home/lib/junit
started jmeter
created new thread
added new sampler for JUnit request
However when I check "Classname" drop down my test is not listed there.
Does anyone know why test is not recognised by JMeter?

check whether scripts exported using junit4.
If yes, then select "search for junit4 annotations" check box. surely it will display.

After creating Junit jar file . Place the jar file in the
jmeter.home\lib not in jmeter.home/lib/junit.
After that Restart Jmeter.
Now add thread group to jmeter and Junit Request sampler.
Observe that the Classname apperas in the drop down list

Related

Error `Unable to find a template property named $schema.` when trying to decompile JSON into Bicep

I'm playing with Azure Bicep and I was expecting that I can take practically any ARM JSON template and translate it into Bicep. I'm intentionally using the word "translate" instead of "decompile" here, because the JSON template was not originally created with Bicep, so it was not compiled from Bicep to JSON in the first place.
I'm creating a VM deployment in the Azure Portal and when it's successfully deployed I download the JSON template (deployment.json and deployment_operations.json).
Then I run the following command:
bicep decompile deployment.json
The command fails with the following error message:
/deployment.json: Decompilation failed with fatal error "[1:1]: Unable to find a template property named $schema."
What should I do to resolve this error?
Bicep CLI version 0.13.1 (e3ac80d678).
PS The VM deployment is the simplest possible Windows Server VM with no data disks and extra features. Created via Azure Portal by clicking Next-Next-Create.
It appears that I've found the solution when writing the question. I was downloading and trying to decompile a wrong file.
The problem was that I was downloading the deployment.json file instead of an actual template file template.json. You need to click Download on the Template tab.
So instead of downloading the from the Overview tab, click the Template tab and then click Download. Or use the Save-AzResourceGroupDeploymentTemplate PowerShell cmdlet.
Similar problem, same solution: https://github.com/Azure/bicep/issues/5237

Testcafe: find current working directory from test

I have a working TestCafe test suite which generates a custom xml report generated by code in the test suite. I would like to place this report in the "standard" ./results location that TestCafe uses for its reports, but I can't find an option to retrieve the current working directory (e.g., the bash pwd command).
I'm getting it by adding export pwd=$(pwd) on the command line when I run the test, but I wonder if there's a built-in mechanism in TestCafe to do this?
If you run the tests from the command line, you can just use the reporter option as follows:
testcafe chrome test.js --reporter xunit:results/output.txt
See this question for details: How to save report results from console to a file (TestCafe)?.

JSON - Bluemix application in Eclipse Mars

I imported my Bluemix application into Eclipse. When I open it, I get a JSON error. What do I have to do to not get this error? Is there a tutorial for this?
EXAMPLE
That's not a JSON error actually. Most likely the IDE is not able to find the JSONObject class during the project build. If you leave the mouse pointer on the JSONObject class name you will read the error (actually I suggest you to enable the problems view to see all the errors: Windows->Show View->Problems).
You need to make the class JSONObject available to DemoServlet fixing the project java build path.
I guess you are using personality-insights-java. I've just tried to import it in a blank Eclipse project and I managed to build it correctly.
I am assuming that you have a local instance of Liberty server on which you want to run the application. If not see here. Go to step 2 only when you have a local working application server in Eclipse
double check that the project Java Build Path (right click on the project->Properties->Java Build Path) contains Liberty libraries (Libraries->Add Library->Server Runtime->WebSphere Application Server Liberty)
If the auto-build is not enabled, manually clean and build the project (Project->Clean)

How to get karma javascript junit xml reports into sonar

Is there a karma reporter which can be used to generate a results.xml file which is compatible with the sonar Generic Test Coverage plugin? Or alternatively a parser for the junit file which is output by karma-junit-reporter and which will work with the generic plugin?
I am using SonarQube 5.3 and Karma / Jasmine
I want to import the junit reports that come from karma into SonarQube but cannot see a way to do this easily. Something like https://www.npmjs.com/package/mocha-sonar-generic-test-coverage for karma
FYI I have seen
karma-junit-sonarqube-reporter (https://www.npmjs.com/package/karma-junit-sonarqube-reporter) but that seems to expect the name of the test to match the path to the file which is too restrictive for me.
karma-sonarqube-unit-reporter seems to be unfinished
grunt-karma-sonar seems to rely on jstestdriver which is deprecated
I managed to achieve this by doing the following.
To get javascript junit reports into sonar
find and download sonar-karma-test-report-plugin-1.0.0.4.jar which is not available via the update center
put jar file in /usr/local/Cellar/sonar/5.3/libexec/extensions/plugins and restart sonar
Tell karma to omit the name of the browser
junitReporter: {
useBrowserName: false
}
Get Karma to create a junit xml file via the normal karma-junit-reporter and have it call the file TESTS-xunit.xml (I had the file called test-results.xml and sonar would not detect it WTF)
In the sonar-project.properties file set sonar.javascript.karmajstestdriver.reportsPath=reports/js/unit-components/results/
call sonar-runner
Sonar requires the path to the test file in order to process the report. Jasmine does not make this available to the reporter. My understanding is the sonar plugin iterates over xml file and finds the classname for each test which has the test name (ie my cool tests) and does a string replace to change that to the location of the file

Custom Reporting to Jenkins

I'm trying to hook up our own private testing tool to Jenkins. I'm able to run the test through the command line and create a report on my local machine. I will need to convert that report to xml JUnit format, specifically for Jenkins. Once that is done, how do I associate the xml file that was just created to the most recent job. This way the correct report gets put with the correct job?
The way Jenkins works is simple: you create a job and Jenkins runs it. Every run of a job is called a build. If you configure the job to look for test report files at the end of a build, the test reports are loaded and presented in the Jenkins UI. There is no way to submit test reports to a build outside of the build or after the build.
Usually this is not a problem. You run your test program/script as part of the build and it produces xml files in the JUnit format. When all the build steps are done, Jenkins looks for the xml files and loads them. You have to tell Jenkins to do it, though. You open the job configuration and you add a new post-build action titled "Publish JUnit test result report". Then you give Jenkins a pattern it uses to search for the files. You can use **/*.xml which means Jenkins will look for all *.xml files in every directory and subdirectory. Or you can e.g. use **/testreports/*.xml if you know where the test reports are going to be.