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.
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.
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?
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.
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?
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:
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.