Load testing with Katalon and Jenkins

Hello,

I want to know if it possible to somehow integrate katalon studio test cases into Jenkins and then perform a load testing using Jenkins ? Why I am asking that. All of API test cases are made in katalon studio and I want to perform actions to make a load testing. Well I know that JMeter is the right way to make load tests but for that I should create another test cases in Jmeter.

if you realy want ti glue all togheter in katalon, i think you can import jmeter core jars (and plugins needed) into katalon, but that will involve some research.
i never tried but i know it is possible to use jmeter libs in custom java projects

check this for inspiration:

1 Like

however, keep in mind that jenkins has also dedicated plugins for jmeter (based on taurus if i remember it right) … so you can just glue all your tests at the CI level : use katalon plugins for functional testing (or docker image) and jmeter plugins for performance testing

Thanks for information, I will read that topic if it helps me.

You shouldn’t involve Katalon into load testing. Just use JMeter in Jenkins. That’s the way.

1 Like

I’ve imported jar files into katalon studio what was said in stackoverflow, but now I can’t execute test cases, it says :

Caught: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
Caused by: groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-all is loaded in version 2.4.16 and you are trying to load version 2.4.7

welcome to the dark side of java, where different libs neede different versions of same lib
seriously, just use jmetter as it is. too much headache to reinvent the wheel.
whit the effort spent to fix such conflicts, and whatever else may apear further … is not worth it.
in the same time you can write at least ten jmeter templates from scratch

Yeah too much headache… I have one more question if it is possible to make. Is there any kind of tool that can catch test case executions and make load/performance tests ? I mean every test case is written in Katalon Studio, so I must rewrite all of them in Jmeter, that’s why I am looking for something to make it easier. For example, one of test case is, that user is trying to login into page and then he will logout, and can be there something to get load times, in what time was he logged in and then logged out ?

How many users simultaneously do you want to simulate performing this login-logout session? 1 user or 300 users?

If you want to perform simultaneous 300 users sessions to measure the performance/resource usage of the server side, you would want JMeter. Katalon Studio is not a tool to do this.

However, it seems to me you just want to measure in Katalon Studio how long it takes in milliseconds for a single user to perform login-logout session. If so, you do not need JMeter at all. All you need is Apache Commons StopWatch

See the following sample test case script.

import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

import org.apache.commons.lang3.time.StopWatch

import internal.GlobalVariable as GlobalVariable

WebUI.openBrowser('')

WebUI.navigateToUrl("http://${GlobalVariable.Hostname}/")
WebUI.verifyElementPresent(findTestObject('Page_CuraHomepage/a_Make Appointment'),
	10, FailureHandling.STOP_ON_FAILURE)

StopWatch stopWatch = new StopWatch()
stopWatch.start()
WebUI.callTestCase(findTestCase('Common/Login'),
	[
		'Username': GlobalVariable.Username,
		'Password': GlobalVariable.Password
	],
	FailureHandling.STOP_ON_FAILURE)
stopWatch.stop()
WebUI.comment("Call to Comon/Login took ${stopWatch.getTime()} milliseconds")

WebUI.closeBrowser()

This test case emits the following message.

Call to Comon/Login took 1332 milliseconds

A reproducible project is available at GitHub - kazurayam/CURA-Test-Project: Qiitaに投稿した記事「Katalon Studioでテストを自作した」のサンプルコード
See “Test Cases/Main/LoginTest”.

1 Like

Jmeter has his own mean to record a session.

see: Apache JMeter - Apache JMeter HTTP(S) Test Script Recorder

that in fact is not performance testing, despite the word ‘load’ :D. is still functional testing

In performance testing, you do a certain known scenario (e.g load certain bunch of pages in browser, or do some API calls, or do some DB transactions or all of them) repeatedly, with certain numbers of threads (users) in parallel for a given time (minutes, hours, depending of the test type: load, stress and so on) and measure some indicators (no. of transactions per second performed by the application, response times, server load etc)
Performance testing it is actually performed to determine the server/infrastructure behaviour, not to test the application functionalities
This is why usually it is done as the last component in the development/approval cycle of an application, after all features are functionally tested and approved as stable.

1 Like

hi,

just use only Jmeter to perf testing it’s easy to extend with BeanShell (java) scipting

Hello everyone,

Currently, you can integrate Katalon Studio with JMeter via the JMeter Integration plugin which is free. Alternatively, you can manually integrate those two tools yourself by following this guide.

Cheers

Jass

1 Like