Katalon Studio 8.0.0 much slower in opening and saving files

Good morning @duyluong

It only happens in test cases. Not in suites or BDD step definitions.

Here is a sample testcase. When it opens, it takes 8 to 10 seconds. If I add a space in a comment line and save, it takes 8 to 10 seconds.

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.checkpoint.CheckpointFactory as CheckpointFactory
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testcase.TestCaseFactory as TestCaseFactory
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testdata.TestDataFactory as TestDataFactory
import com.kms.katalon.core.testobject.ObjectRepository as ObjectRepository
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WSBuiltInKeywords
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUiBuiltInKeywords
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import internal.GlobalVariable as GlobalVariable
import com.kms.katalon.core.configuration.RunConfiguration as RunConfiguration
import org.apache.commons.lang3.StringUtils as StringUtils
import org.openqa.selenium.Keys as Keys
import groovy.time.TimeCategory as TimeCategory
import com.kms.katalon.core.util.KeywordUtil as KeywordUtil
import org.openqa.selenium.By as By
import org.openqa.selenium.WebDriver as WebDriver
import org.openqa.selenium.WebElement as WebElement
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
import groovy.time.TimeCategory
import com.katalon.cdp.CdpUtils
import com.katalon.utils.OsUtils

def curGlobalStatus = CustomKeywords.'cannabisCommon.ModifyCSVFile.GetkeyValue'(GlobalVariable.currentTestSuiteId)
def Date today = new Date()


	todaysMonth = today.format('MM')
	todaysYear = today.format('YYYY')
	todaysDay = today.format('dd')
	todaysHour = today.format('hh')
	todaysMin = today.format('mm')

if (((GlobalVariable.currentTestCaseId == curGlobalStatus) || (curGlobalStatus == 'Success')) || (curGlobalStatus == '')) {

	def testFiles = RunConfiguration.getProjectDir().replaceAll('/', '\\\\') + '\\TestFiles'

	
	String seniorPersonInCharge = testFiles + '\\PhotoID - SeniorpersonInCharge.txt'
	String licenceHolder = testFiles + '\\PhotoID - Licenceholder.txt'
	String seniorPersonInChargeDocument = testFiles + '\\SeniorpersonInCharge.txt'
	
	
	if (row_number > 0) {
		// write current row number to globalvariable
		// This is then used in after test case to flag the testcase that errored on the current row
		GlobalVariable.currentRowNumber = row_number
	}

	String curAccountID = GlobalVariable.PortalAccountId

	if (RP != '')
		curAccountID = RP

	//	def configuredAccounts = CustomKeywords.'cannabisCommon.ManageLocalConfig.GetPortalAndCRMAccounts'()
	//	String alternate1 = ""
	//	String alternate2 = ""
	//String altResponsible = ""
	if (dataFile == '0') {
		def configuredAccounts = CustomKeywords.'cannabisCommon.ManageLocalConfig.GetPortalAndCRMAccounts'()
		if (configuredAccounts[5] == "") {
			// Throw error that alternates 1 and 2 are missing
		} else {

			//			alternate1 = configuredAccounts[4]
			//			alternate2 = configuredAccounts[5]
			AltRP = configuredAccounts[5]

		}
	}
	if (licAppStatus != 'Success') {

		WebUI.click(findTestObject('Object Repository/Portal/Licence Applications/Page_Licence Application - Index/a_Licence Ownership'),FailureHandling.STOP_ON_FAILURE)

		CustomKeywords.'utils.waitForReadyState.waitForJS_Complete_Ready'(1)
	}

	if (ownership == "I"){

		WebUI.click(findTestObject('Portal/Licence Applications/Page_Licence Application - Licence/input_LicenceOwnershipType_Individual'),FailureHandling.STOP_ON_FAILURE)

		//WS.delay(2)
		CustomKeywords.'utils.waitForReadyState.waitForJS_Complete_Ready'(1)
		//		WebUI.setText(findTestObject('Object Repository/Portal/Licence Applications/Page_Licence Application - Licence/input_CRABusinessNumber'), '123456782',FailureHandling.STOP_ON_FAILURE)
	} else if (ownership == "C"){ // Its a corporation
		WebUI.click(findTestObject('Portal/Licence Applications/Page_Licence Application - Licence/input_LicenceOwnershipType - Corporation'),FailureHandling.STOP_ON_FAILURE)

		'Get corporate profile guid from csv'
		String guid = ''
		if (dataFile == '0'){
			guid = CustomKeywords.'cannabisCommon.ModifyCSVFile.GetkeyValue'('Last_Corporate_GUID')
		} else {
			guid = corporateGuid
		}

		WS.delay(2)
		WebUI.selectOptionByValue(findTestObject('Portal/Licence Applications/Page_Licence Applications - Industrial Hemp/select_Corporation name'), guid, true,FailureHandling.STOP_ON_FAILURE)

	}
	
	
	WebUI.click(findTestObject('Object Repository/Portal/License Applications/Page_Licence Application - Licence/a_Edit - SeniorPersonInCharge'),FailureHandling.STOP_ON_FAILURE)

	CustomKeywords.'utils.waitForReadyState.waitForJS_Complete_Ready'(1)

	if (runWCAG == 1) {
		String url = WebUI.getUrl()
		// remove https://ctls-sscdl.uat.hc-sc.gc.ca/  from the url and replace '/' with '-' and remove trailing slash value  so QA/LicenceApplication/SiteDetails/b3b1af84-f8be-eb11-8145-005056812cba
		// become QA-LicenceApplication-SiteDetails
		// todaysYear + '-' + todaysMonth + '-' + todaysDay
		def (host, port) = CdpUtils.getServiceEndpoint()
		OsUtils.runCommand("lighthouse ${url} --hostname ${host} --port ${port} --preset=desktop --output-path=..\\Katalon_Local_Config\\WCAG\\CDL-New-Ownership-Popup-${todaysYear}-${todaysMonth}-${todaysDay}-${todaysHour}${todaysMin}.html --no-enable-error-reporting", null, null)
	}

	WebUI.setText(findTestObject('Object Repository/Portal/Licence Applications/Page_Licence Application - Licence/input_ResponsiblePersonAccountId'), curAccountID,FailureHandling.STOP_ON_FAILURE)

	WebUI.click(findTestObject('Portal/Licence Applications/Page_Licence Application - Licence/button_Validate'),FailureHandling.STOP_ON_FAILURE)

	CustomKeywords.'utils.waitForReadyState.waitForJS_Complete_Ready'(1)


	WebUI.click(findTestObject('Portal/Licence Applications/Page_Licence Application - Licence/button_Save  Close'),FailureHandling.STOP_ON_FAILURE)

	//WS.delay(2)
	CustomKeywords.'utils.waitForReadyState.waitForJS_Complete_Ready'(1)
//	if (AltRP != '') {
//		// add alternate responsible person
//		WebUI.click(findTestObject('Object Repository/Portal/Licence Applications/Page_Licence Application - Licence/a_Edit -AltRP'),FailureHandling.STOP_ON_FAILURE)
//
//		CustomKeywords.'utils.waitForReadyState.waitForJS_Complete_Ready'(1)
//
//		WebUI.setText(findTestObject('Object Repository/Portal/Licence Applications/Page_Licence Application - Licence/input_AltResponsiblePersonAccountId'), AltRP,FailureHandling.STOP_ON_FAILURE)
//		WS.delay(2)
//		WebUI.click(findTestObject('Object Repository/Portal/Licence Applications/Page_Licence Application - Licence/button_Validate - AltRP'),FailureHandling.STOP_ON_FAILURE)
//		CustomKeywords.'utils.waitForReadyState.waitForJS_Complete_Ready'(1)
//
//
//		WebUI.click(findTestObject('Object Repository/Portal/Licence Applications/Page_Licence Application - Licence/button_Save Close - AltRP'),FailureHandling.STOP_ON_FAILURE)
//
//		//WS.delay(2)
//		CustomKeywords.'utils.waitForReadyState.waitForJS_Complete_Ready'(1)
//
//	}
	if (ownership == "I"){
		WebUI.sendKeys(findTestObject('Object Repository/Portal/License Applications/Page_Licence Application - Licence/input_PhotoID-SeniorPersonInChargeSecurityDoc'), seniorPersonInChargeDocument)
		WebUI.click(findTestObject('Object Repository/Portal/License Applications/Page_Licence Application - Licence/button_Upload - 2'))
		CustomKeywords.'utils.waitForReadyState.waitForJS_Complete_Ready'(2)

		WebUI.sendKeys(findTestObject('Object Repository/Portal/License Applications/Page_Licence Application - Licence/input_PhotoID-SeniorPersonInCharge'), seniorPersonInCharge)
		WebUI.click(findTestObject('Portal/License Applications/Page_Licence Application - Licence/button_Upload'))
		CustomKeywords.'utils.waitForReadyState.waitForJS_Complete_Ready'(2)

		WebUI.sendKeys(findTestObject('Object Repository/Portal/License Applications/Page_Licence Application - Licence/input_PhotoID-LicenceHolder'), licenceHolder)

		//WS.delay(2)

		WebUI.click(findTestObject('Portal/License Applications/Page_Licence Application - Licence/button_Upload - 3'))
		CustomKeywords.'utils.waitForReadyState.waitForJS_Complete_Ready'(2)
	} else if (ownership == "C"){ // Its a corporation
		WebUI.sendKeys(findTestObject('Object Repository/Portal/License Applications/Page_Licence Application - Licence/input_PhotoID-SeniorPersonInChargeSecurityDoc'), seniorPersonInChargeDocument)
		WebUI.click(findTestObject('Object Repository/Portal/License Applications/Page_Licence Application - Licence/button_Upload - 2'))
		CustomKeywords.'utils.waitForReadyState.waitForJS_Complete_Ready'(2)

		WebUI.sendKeys(findTestObject('Object Repository/Portal/License Applications/Page_Licence Application - Licence/input_PhotoID-SeniorPersonInCharge'), seniorPersonInCharge)
		WebUI.click(findTestObject('Portal/License Applications/Page_Licence Application - Licence/button_Upload'))
		CustomKeywords.'utils.waitForReadyState.waitForJS_Complete_Ready'(2)


	}
	WebUI.click(findTestObject('Object Repository/Portal/License Applications/Page_Licence Application - Licence/button_Save  Next'),FailureHandling.STOP_ON_FAILURE)

	//WS.delay(2)
	CustomKeywords.'utils.waitForReadyState.waitForJS_Complete_Ready'(1)

	return 'Success'
} else {
	KeywordUtil.markWarning('Force Skipped')
}

Hi all,

Apologies if this is not related but the sample BDD Katalon project (calculator), goes to “Not Responding” on every file change and save for about 5 seconds. - Version 8.0.1

This is the exact same behaviour, but was not happening to me on BDD groovy step definition (.groovy) but only on test cases (.groovy). Maybe it is related to what we are using within the groovy files (An import/method call)?

@danpoleary

Please tell us where (in which folder) you installed Katalon Studio?

Somewhere under the C:\Users\yourOsUserName? Or somewhere under the root C:\ ? (such as C:\Program Files(x86)) ?


@danpoleary

In your Test Case script I noticed the following lines:

These must come from some Plugins.

Are you sure you have those Plugins installed in you current version of Katalon Studio?

@danpoleary

Just try the following, please.

Stop your Katalon Studio, and in the command line, do

$ cd %KATALON_STUDIO_INSTALLED_FOLDER%
$ eclipse.exe -clean

or like this

I am on Mac now, and I do not have Windows with Katalon Studio, so I am not sure what exactly the name of Katalon Studio binary on Windows is. Please check your environment.

This will force Eclipse inside Katalon Studio to initialise its various internal caches safely and let it start clean. See https://stackoverflow.com/questions/2030064/how-to-run-eclipse-in-clean-mode-what-happens-if-we-do-so for info.

Once Katalon Studio started, try working on your problematic project. Any difference?


Also you may try installing Katalon Studio v8.0.x into a new folder.

I mean, do not do “in place update” in UI as described in the doc.

Rather download the zip of v8.0.x manually, and unzip it into a new folder.

@duyluong
@ThanhTo

As you may be aware of, the Eclipse IDE’s README document writes;

Platform - Install/Update

Manually installing features and plug-ins on a FAT file system (Windows only)

When features and plug-ins are manually installed on top of an Eclipse-based product install located on a FAT file system that has already been run at least once, the product must be explicitly restarted with -clean. That is,

eclipse.exe -clean

I could find this document on my Mac at file://<eclipse installed directory>/eclipse/java-2021-03/Eclipse.app/Contents/Eclipse/readme/readme_eclipse.html


Cleaning the Eclipse’ internal cache with -clean option sometimes solve subtle problems which occur when you have removed or changed some externally installed plugins to Eclipse and other Eclipse’ settings.

I suppose the Content Assist feature of Java/Groovy Editor UI, which is invoked by Ctrl+Space key stroke, is dependent on the cache of classes. Any reference to a cached class, which was contained in a plugin and now is missing as the plugin has been removed, may cause failure & recovery (so called “the reconcile process”). The “reconciliation” would make the Editor slow.

I guess, upgrading the product package (e.g, KS 7.8.x -> 8.0.0) possibly includes some changes of bundled plugin. Most of the users would not be affected by the change as they are likely not using the problem plugin, but some heavy users who are dependent on the problem plugin may encounter difficulties.

Katalon Team should advise users (on Windows only) that they should do -clean once after upgrading Katalon Studio if they update Katalon Studio in-place.

If users install a new version of Katalon Studio into a new folder while leaving the older one, and switch to the new installation, they would not need -clean as the new installation is already clean.

I personally never do in-place update of Eclipse (=Katalon Studio) on Windows, I always create new installation for each versions; because I am worried about difficulties that tends to occur after in-place update.

It would be a good idea if you bundle another Katalon Studio launcher icon with -clean option specified in the distributable. Users will just double click it to launch Katalon Studio with -clean option after upgrading the version.

Note that it takes far longer seconds to launch Eclipse with -clean, so that we would not like it usually.

Hi @kazurayam,

I tried both an in-place update and a fresh install/unzip. Everything is installed under C:\development\apps.

I have tried -clean.

The two imports are for custom keywords, and are not from plugins.

None of these have an impact on my issue.

I am attempting to write a testcase which I will add imports one by one to see if one of them is causing the issue. I will then try adding method calls one by one.

Dan

@kazurayam I also noticed something different, if I copy a testcase that has a save issue to a new testcase, then the save on the new one is instant. The only difference is the new testcase is not part of any testsuites. I am now creating a bunch of fake testsuites that include that new testcase to see if that starts to slowdown that testcase save.

Results: Being part of a number of testsuites did not slow down the saves.

@duyluong

After much testing, I think I found the issue. If a testcase has a large number of variables, then the opening or saving of that testcase gets very slow. If I create a testcase with no variables, save is very quick. I just add variables, then it becomes very slow to save. The rest of testcase can be empty.

I am now creating a new testcase and slowly adding variable of different types one by one to see when the saving gets slow. I will let you know the results soon.

Results: after adding the 5th variable (I used String, Number, String, Number, String) it starts to get slow to save. I close the file and reopen and it is slow to load.

Something changed in variable handling to cause this.

I have a doubt about this location.

Would you try installing it under the C:\Users\yourOsUsername folder where your Windows user have full access privilege so that KS can surely WRITE files into ?

Well, I don’t think so.

I know …

import com.katalon.cdp.CdpUtils

this must come from Chrome DevTools Integration plugin

import com.katalon.utils.OsUtils

this must come from Katalon Utilities.

They rely on those plugins which I have from Katalon managed plugins.

We cannot run under our user accounts since it is managed by our security group. Thy prevent us from installing or running anything in c:\users… (They scan and remove things)

If you noticed earlier, I found the issue is with testcase variables. I got the rest of our team to reproduce my findings, and in all cases, 5 or more variables start to slow down save and open of a testcase. The more variables the slower. This does not happen in 7.8.2, and I will be retrying in the 7.9 series as well.

@danpoleary

Ok. Could you try installing KS under C:\Users\yourAccount just once and see if it doesn’t help at all?

@Kazurayam I tried under my user account and it still takes 8 to 10 seconds. Like I mentioned earlier, it is tied to the number of variables in a testcase. After the 5th variable is added, the performance of open and save starts to be noticeably slower. Try it on yours. create a testcase, could be empty, and start adding variables. You will see it get slower and slower to save.

No, I do not see it.

You shared your test case script. I made a project where I made a test case with your code. I can open, save, update it quickly. I don’t see any slowness. Your issue seems to be hard to reproduce on in other’s environment.

Noticed similar slow performance on a totally fresh install of Katalon Studio 8.0.1 on Windows 10 (1909).
The project is a small demo project with 4 scenarios in a feature file along with a groovy script in default package for step definitions. If separate step methods are defined for each scenario (example) then the error is resolved.
Event log has the following -
CodeSelectRequestor: Could not proceed due to null declaring type for org.codehaus.groovy.ast.expr.ConstantExpression

Maybe related error - does not have matching glue code for example in line xyz.

feature file

Scenario Outline: Scenario_Name
    Given I have to run Param1 <Param1> Param2 <Param2> Param3 <Param3> Param4 <Param4> Param5 <Param5>
      | Param6  |
      | P6Val1  |
    When I start
    Then result should be success

Examples: 
  | Scenario    | Param2    | Param3    | Param1 | Param4 | Param5 |
  | Scenario1   | P2Val1    | P3Val1    | P1Val1 | P4Val1 | P5Val1 |
  | Scenario2   | P2Val2    | P3Val2    | P1Val2 | P4Val2 | P5Val2 |

groovy file

	@Given("I have to run Param1 (.*) Param2 (.*) Param3 (.*) Param4 (.*) Param5 (.*) Param6 (.*)")
	def I_have_to_run_Param1_Param2_Param3_Param4_Param5_(String Param1, String Param2, String Param3, String Param4, String Param5, String Param6) {
		// Write test here
	}

FYI - I recreated the issue when I installed the Katalon Studio sample cucumber project from Git.

Good morning @kazurayam,

Did you add variables to the variables tab? The code I provided did not have the variables tab entries.

I do not do anything on the variables tab.

I remember I saw a lot of variable names in the code were underlined; that would mean the names were supposed to be declared in the variables tab; but I left them underlined. I could edit the code, save it, open/close it quickly.

@kazurayam @duyluong
You need to add one variable at a time to the variables tab, and save after each. Once you reach 5, it will start to be noticeably slower, The more you add, the slower… This does not happen in the 7.8.2 release, and I still need to verify it did not happen in the 7.9.x releases, but I do not recall any issues . I really notice it in the 8.0.x versions.