Method code too large In Katalon v5.4


#1

Katalon Version 4.5, Chrome, Windows 7
We are seeing “Method code too large” errors when running test cases that are 360 or more lines long (manual view).

Katalon Version 3.5.1 (same as above).
Validated that the same 360+ line test cases will run correctly in version 3.5.1. Also validated that test cases that are less than 360 lines long will execute properly in version 4.5.


#2

Can you help to provide your test script? By the way, you mean Katalon Studio 5.4, right?


#3

Hi Vinh,
Sorry about that, not sure what I was thinking. Should have been Katalon 5.3.1 & 5.4.
I will not be able to provide you with a copy of my script because it is mostly internal and would fail anyways. But I will attach a log file tomorrow as I am able to replicate this issue on a regular basis.


#4

Hi Vinh,
I have created a skeleton project where the test script will not run due to missing variables and the like but it does result in the “Method code too large!” error. The project is too large to load here… Is there an email address I can send the file to so you can reproduce the error? Or does Katalon have a GIT helpdesk area where I could load the file for you to download?


#5

Hi Vinh,
Any news on where I could load the file for you?
Thanks,
Dave


#6

Okay I loaded the file here: https://github.com/Tigger99/Katalon-v54-issue
Click on KATALONV54 ISSUE.zip

Click on Download

Save to local system
Open in Katalon 5.3.1 and run cases… Error does not result
Open in Katalon 5.4 and run cases… Error does result


#7

Hi ,
This is still an issue.
Can one of the Katalon team members check into this issue?

Thanks,
Dave


#8

Any updates on this issue?


#9

Hi,
This is still an issue for our team and is preventing us from moving to Katalon 5.4.

Best regards,
Dave


#10

Hi all,

We do not touch anything into this core, so we will take a look at it and inform you soon :slight_smile:

Regards


#11

Hi Dave,

Upon analyzing this issue, we’ve figured out your current code where this issue happens is TOO big which is not a good practice. The current solution is you need to separate your whole script into smaller functions and put one or some of them into a separate test. You can either group similar actions into a custom keyword and call it instead

That’s a general idea, we will also looking at this issue to see if we can work on it.


#12

Hi Vinh,
I am not sure why our code is TOO big for 5.4 but not TOO big for 5.3.1?
Big thanks for looking into the issue.

Best,
Dave


#13

I can confirm the same issue. Script of 780 lines wont work in 5.4 and 5.4.1. In 5.3.1 it runs ok and i am not geting Method code too large error.
What changed in versions? Is there a fix in next versions?


#14

Please be patient, we are investigating it and will reply to you guys soon once we’ve got enough information.


#15

Hi there,

Upon checking again in our latest version, the root cause is 5.4 introduce Test Listeners which will append the current size of a test case. However, we can’t adjust it accordingly and we also observe that your current test script is quite long, which is really not a good practice in the future. If we try to adjust test script’s size to be adaptive with yours, then in the future there will be someone write a longer test case than you. In this case it is not a really good solution, and also having a large test case will be very hard to maintain later.

So we’ve decided to not change it right now, and we suggest you split your current code into smaller test cases:


#16

Thank you for info.


#17

I have the same problem and this is not a file size error.
I have the same test case that works on my computer and yet generate an error when running it on a virtual machine.
It may be related to how temporary files are created or in the Java memory reserve.