After searching for a long time I was not able to find a proper solution or documentation on how to run predefined JDBC JMeter Test Suites from java code. The tests have been defined in the JMX format.
I know that you can run it with the jmeter-n.cmd, but I need to execute the test from within my code.
Also, the Runtime.exec solution (as described in the link) is not feasable, as I cannot go out of my JVM.
How to create and run Apache JMeter Test Scripts from a Java program?
Using the JMeter API or GUI, I was able to create some http and JDBC tests - but not run predefined ones.
Creating JDBC tests in the API did not work at all.
There is some basic documentation around, but I can only find solutions on how its done in the GUI.
Thanks and best regards
Refer to 5 Ways To Launch a JMeter Test without Using the JMeter GUI guide, it provides walkthrough on how to launch existing .jmx file from Java code and additionally clarifies how to build a JMeter test plan via API.
Related
I want to write a chaincode in JAVA. Can I use eclipse? How can I write and test the chain code? It is my first time to learn how to develop chaincodes for Fabric. I know JAVA and I know how to write smart contracts for Ethereum where I use Remix.
Any help is appreciated. Is there a way to write and test the chaincode in JAVA without creating a network? as in just like in Remix..
Can I use eclipse?
You can use your favorite editor, is just Java what you are writing.
How can I write and test the chain code?
Follow the examples on the java chaincode repo, depending on what version of fabric you are using checkout to a branch or another. Take on account that there is a big difference between the version 1.X and 2.X . The examples that they provide are very good and you can use maven or gradle. To test the chaincode you can write unit testing with Junit and mock the shim.
Take on account that the chaincode is going to be embeded on a docker container, debugging is done by logging, so you will need to log a lot.
Is there a way to write and test the chaincode in JAVA without creating a network
Use unit testing before deploying the chaincode, unit testing here is the most important thing. The shim what it does is going to write and read so the logic that goes inside is the most important part. To testing on "real" mode you will need a network, it does not need to be big, with any example networks that are provided with the examples repo will be more than enough.
I need to run performance tests on a web application and was wondering if the following can be accomplished with Apache JMeter.
I need to simulate approximately 300 users accessing an application over a set time frame (e.g. 300 users over 10 minutes) and doing some actions, for example:
Logging in
Navigating to different pages
Inputting data
Submitting forms
I'm quite new to JMeter and performance testing in general and was wondering if this is possible? Otherwise are there any better (free) alternatives?
Many thanks.
Of course, it is possible using JMeter.
I would recommend using JMeter/ Blazemeter Chrome extension. BlazeMeter's Chrome extension let you test your application without prior scripting knowledge. It is very easy to create a test with BlazeMeter's Google Chrome extension. Here are some blogs that will help or guide you to use Chrome extension and forth.
There is another option, that is JMeter build in Test Script Recorder. Go through This thread for further detail.
Follow any one of the two procedures to record your scenario and then customize the imported script according to your requirement.
First, record your scenario using Chrome Extension.
Import the generated .jmx file to your Jmeter.
Configure the Test plan according to your requirement.
Actually this is what JMeter is designed for.
For the basics following documentation chapters are very useful:
Building a Web Test Plan
Building an Advanced Web Test Plan
When it comes to the load distribution just use separate Thread Groups to represent different groups of virtual users (like some users are logging in, another are navigating pages, etc.). If you have only one group of virtual users and several actions to simulate you can go for Throughput Controller
I'm trying to understand what is provided by ci.gitlab.com. I would like to create a build using Gradle for my Java project and have it all run on ci.gitlab.com servers.
The process for adding a runner seems to involve leveraging a localized installation of GitLab CI. There are shared runners available, but they seem to be geared toward Ruby, Node, etc.
Is it possible to use ci.gitlab.com for a fully hosted CI solution?
Its not important if there are only Ruby, Node or other Runners. If they are shared runners, you can specify the image in your .gitlab-ci.yml which the runners use to run you tests. See here (i wrote a example .gitlab-ci.yml):
The runners will pull the right image and will run your tests in the specified image.
More information here.
I'm trying to figure out the best way to automate the execution of and result recording of load tests. We currently use Maven; ideally the solution would be executed as part of the Maven project life-cycle, so that people do not need so spend time on effort setting up the tests.
It should save the output of the tests (e.g. as some files that could be committed into version control), and should have the sense to not compare tests run on a dusty x486 with a 8 core Sparc.
JMeter is another Apache project which is very well adapted for automation (you can control most things from the command line); there are also several plugins that you can use to integrate it into Maven. Personally, I think this is by far the best tool for this sort of requirement.
You still need to create the actual tests to run and decide which environment to use - but this will always be the case no matter which tool you choose.
Have a look here, here and here.
Is there a way of browsing a web site through a proxy and autogenerating Java code (using HtmlClient) that can play back the requests?
Take a look at Selenium. You can use the Selenium IDE to record a session, and then choose use the "Export" menu item to export it to Java tests. You can then use the Java Client Driver to run the tests.
Not sure what your code generation needs are. Have you looked at Apache JMeter that records test cases through a proxy and also provides interfaces for you to generate your own data.