Load testing with Katalon and Jenkins

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