Getting Started - JAVA
Follow this guide for a basic example of running a Java program. For our example we will use a really simple test plan which simply makes an HTTP GET request for http://sample.testable.io/stocks/IBM.
Start by signing up and creating a new test case using the Create Test button on the dashboard.
Enter the test case name and then press Next.
Scenario
Select Java (JUnit, TestNG) as the Scenario type.
Let’s use the following settings:
- Framework: None
- Source: Create/Edit/Upload *.java File(s). We can also connect our scenario to version control or upload an entier project, but for now let’s just create the files in the browser.
- Main Class Name:
TestClass
Press the Generate Example button to get an example .java file for testing.
Click the Smoke Test button in the upper right to run your test plan with 1 thread and 1 iteration on a Testable test runner. The output of the run will show up in the Smoke Test Output once it finishes.
And that’s it, we’ve now defined our scenario! Click on the Configuration tab or press the Next button at the bottom to move to the next step.
Configuration
Now that we have the scenario for our test case we need to define a few parameters before we can execute our test:
- Total Virtual Users: Number of users that will execute in parallel. Each user will execute the scenario.
- Test Length: Select Iterations to have each virtual user execute the scenario a set number of times regardless of how long it takes. Choose Duration if you want each virtual user to continue executing the scenario for a set amount of time (in minutes).
- Location(s): Choose the location in which to run your test and the test runner source that indicates which test runners to use in that location to run the load test (e.g. on the public shared grid).
And that’s it! Press Start Test and watch the results start to flow in. See the new configuration guide for full details of all configuration options.
For the sake of this example, let’s use the following parameters:
View Results
Once the test starts executing, Testable will distribute the work out to the selected test runners (e.g. Public Shared Grid in AWS N. Virginia
).
The Testable runners execute the Java code with 1 concurrent client for 2 iterations.
The results will include assertions, traces, logging, breakdown by URL, analysis, comparison against previous test runs, and more.
Check out the Java guide for more details on running your Java Code on the Testable platform.
That’s it! Go ahead and try these same steps with your own scripts and feel free to contact us with any questions.