Every Katalon projects have a file named .classpath in the project’s root folder.
Could you share the .classpath file on your Azure environment?
I have a doubt that the .classpath file on your Azure might be somewhat corrupted.
Every Katalon projects have a file named .classpath in the project’s root folder.
Could you share the .classpath file on your Azure environment?
I have a doubt that the .classpath file on your Azure might be somewhat corrupted.
I am using Enterprise version V9.2 and please check the attached .classpath file
classpath (30.5 KB)
Also, on my local i am using V9.2 and in azure due to webdriver issues i am using V9.5.
Since v8.2.0, every Katalon project has a folder named .cache.
Unfortunately, this folder causes problems quite sometimes around “Custom Keywords”.
The .cache folder containes the metadata in JSON format about the compiled binary classes of “Custom Keywords”. Please have a look at your project using your favorite text editors (VSCode, etc).
Originally, the folder was purposed as a temporary storage to improve performance. However, it is likely that you have carelessly added the folder into your git repository. The files in the .cache folder could get garbled sometimes for various reasons. And you may unintentionally put the garbled files into the git repositories, which will be cloned out into the Azure pipeline. The garbled files checked out of the repository may result various messes.
Please check the git repository of your katalon project if it contains a .cache folder. If yes, please remove the .cache out of the git repository.
How to remove the .cache foler out of the git repository?
$ cd <projectDir>
$ rm -rf .cache/
$ git rm -r --cached .cache/
$ git commit -m "purge the .cache"
$ git push
Also you should change the .gitignore file; add a line
.cache/
This is to make sure you would no longer add the .cache into the repository.
The source code of .classpath file looks fine.
I guess, you develop your project on your local PC using V9.2, and you push the .cache file into the Git repository. Then your project will be checked out and executed with v9.5 in Azure. Am I right?
In the .cache directory, you will find a file with the same name
as your Custom Keyword sunrisePackage.Unilever_SunriseScript_1. Please open the file with text editor. You will find lines like this:
{
"keywordFileContentHash": "90B19A5B1550CE8D2F6F45340480A969",
....
I guess, the hex-decimal value is the message-digest of the binary class file of the Custom Keyword. I think that diffierent versions of Katalon Studio would generate different values of message-digest of the compiled binary.
Now I guess, you @sureshyadav.devarala have the .cache directory included in the git repository. In the repository the value generated by V9.2 is recorded, but you have V9.5 running in Azure.
This inconsistency could possibly result in the underline of CustomeKeywords. and runtime Exceptions.
— Ah! Poor Katalon! It should never fail here. I believe that Katalon Studio and Katalon Runtime Engine has a bug here.
In Dec 2022 when Katalon Studio V8.0 was released, I posted
@vu.tran of Katalon just disregarded my post. The .cache will annoy people more and more.
Hi @kazurayam,
Thanks for tagging me. WIth all due respect, I always appreciate your inputs and feedback. I am sorry if I have appeared in other way. I will inform this to our internal teams.
@xuan.tran @mverinder please be informed for this feature feedback from Kazu. Can we check and provide feedback from our end?
Best,
Vu Tran
Hi Kazurayam, thanks for identifying this issue, i will upgrade the version and post here if issue will resolve or not.
No.
It is not necessary to upgrade things.
You should remove the .cache folder out of you Git repository, as I wrote here:
I did a small expriment and found something interesting.
I used Katalon Stuidio v9.0.0 Free on Mac.
I had a Katalon project which contains a custom Keyword mock/ExcelIO.
I had a test case named TC1 which uses the custom Keyword.
I found a file <projectDir>/.cache/Keywords/mook_ExcelIO, of which first 2 lines lookd:
{
"keywordFileContentHash": "C9566222EFCED8DA65D82C241B6D6CE8",
...
Now, I opened the file using a text editor and modified it to:
{
"keywordFileContentHash": "",
...
I meant to break the .cache intentionally.
Then I opend the project with Katalon Studio GUI.
In the Test Case editor, in the source code of TC1, I could see the CustomKeywords. part is underlined.
This looked quite similar to what @sureshyadav.devarala saw.
I kept looking at the screeen for a while. I didn’t touch anything. In 10 seconds or so, the underline disappeared automatically.
What happened?!
I operated the text editor to refresh to view of the file under the .cache. Interestingly enough, the keywordFileContentHash property has been restored!
Obviously, Katalon Studio GUI automatically renewed the file under the .cache directory. In the start-up processing when the project was opened, Katalon Studio checked the .cache and found a file is corrupted. So KS regenerated the file.
OK. Now I know, Katalon Studio GUI is designed for failure.
How about Katalon Runtime Engine? — I am not sure if KRE is robust enough for a broken .cache content, but I doubt it.
Katalon Studio and Katalon Runtime Engine — these 2 software has a fundamental difference. KS is a GUI software whereas KRE is a headless software. A GUI software would have a good chance to verify the integrity of files in a project; when it finds any inconsistency. It can cure itself; and continue waiting for user’s manual interventions. On the other hand, a headless software would have limited chance to cure any inconsistencies in a project. Usually, when a headless software finds any difficulties, it throws an Exception and terminates processing entirely. I guess, KRE would not be capable to renew the broken .cache contents.
Unfortunately I do not have KRE license so that I can not verify what I guessed. I would be grateful if someone who owns a required license verifies the robustness of KRE.
I have tried both the solutions i.e upgrade to latest version and removed .cache folder but still on same page.
@mohit.kumar :Also, Extent report is still not generating on azure but working fine on local even after using latest plugin.please find azure logs and yml
Extent report_azure logs.txt (34.5 KB)
Please check the `.cache’ folder.
Do you find a file for com.katalon.extent.report.ExtentReport? ---- I guess, there isn’t.
If the file is there, how is the value of keywordFileContentHash property?
You now have this code:
@Given("User navigate to UFS website")
def User_navigate_to_UFS_website() {
...
CustomKeywords.'com.katalon.extent.report.ExtentReport.attachLog'('Given User navigate to UFS.com')
...
}
Please try chainging it to:
@Given("User navigate to UFS website")
def User_navigate_to_UFS_website() {
...
com.katalon.extent.report.ExtentReport.attachLog('Given User navigate to UFS.com')
...
}
I guess, @mohit.kumar changed something in the way how the com.katalon.extent.report.ExtetReport class is implemented. ---- It is not a Custom Keyword any longer, possibly.
Not the same. You have got a great success.
Previously you, @sureshyadav.devarala , had a underline issue for your custom keyword sunrisePackage.Unilever_SunriseScript_1.
But now you see your custom keyword is NOT underlined. A big difference.
You excluded the .cache folder out of the repository. I am sure that the countermeasure has fixed a problem (but not all).
Now you see an underline for the com.katalon.extent.report.ExtentReport class. That must be another issue. Only @mohit.kumar can look at.
If i use com.katalon.extent.report.ExtentReport.attachLog(‘Given User navigate to UFS.com’)`theni am getting underline for attachlog
which gives No signature error:
Waiting for @mohit.kumar response now.
Me, too.
I guess, the attacheLog(String) method of the com.katalon.extent.report.ExtentReport class is NOT a static class method, is an instance method.
As long as @mohit.kumar provided the method as a CustomKeyword, a static class method or an instance method — this difference is NOT significant. Katalon Studio hides the difference and let a user script call the either methods (static or not).
Now, I supppose, @mohit.kumar changed his code — he removed the @Keyword annotation. Then user script MUST instanciate the com.katalon.extent.report.ExtentReport class first, and then the user script can call attacheLog(String) method. So you need to write like this:
def ext = new com.katalon.extent.report.ExtentReport();
ext.attacheLog('Given User navigate to UFS.com');
I think that the classname com.katalon.extent.report.ExtentReport (singular) should be changed.
They want to be called Extent Reports (plural).
Thanks Kazurayam! It works for me on both local and azure and not getting any underlined things but the original issue of not getting Extent report file is still the concern
@mohit.kumar