How to add certain Test Case in .gitignore?


How not to commit a certain test case file?
I’d like to add certain Test Case in .gitignore


You need to understand how a Test Case is persisted in a Katalon project.

Let me show you an example.

I have a Katalon project named “test”, which has a test case “my/hello”. The following screenshot shows it.

How many files for this test case? — There are 2 files in the project directory.

Where are they? How can I look at them? — in the Scripts folder and the Test Cases in the project’s folder.

You can not look at the 2 files in Katalon Studio. Katalon Studio is designed to intentionally hide the detail. You need to use your favorites text editor. See the following screenshot.

Now you know the path of the files to include in the .gitignore file. You can edit the file as appropriate.

How? — you should read the documents. There are a lot. For example.

Just try.

Why do you want to do that? Just curious. I can not imagine your reason why.

I have a small test case that only do login. This is called by others test cases.
Although using setEncryptedText for the password, it is not safe to store it in git repository.

Do you have any suggestions how to store the password only on my local machine?

I agree with you. You should never store any credentials in a git repository.

The following explains what I usually do.

I store all of my credential informaiton in the KeyChain on my Mac. If I work on Windows, I would use “Credential Manager” that can be found in “Control Panel”.

My Test Case will make a query to the KeyChain for the password of the site to test.

But how? I will install my own custom library named “Subprocessj” into my Katalon project’s Drivers folder. My Katalon Test Case will call Subprocessj which can interact with any external processes (e.g, the KeyChain) that supports command line interface.

Subprocessj is distributed in the Maven Central repository.

1 Like