Click few buttons then read .ini file

Hi all,

Sorry for this very “beginner” question; I’d like to see if, in principle, Katalon can help me in this particular project, before starting to learn more about it:

I have a box (like your broadband router) for which I have built an administrative web interface (LAMP+Bootstrap+Jquery)
After user is playing with all the buttons and fields I provide, the end result is one .ini configuration file that is written on that box.

I would like to automate the testing of this GUI like so: Katalon should select some options, write some values, then click the “save” button. Then, it should get the .ini file, parse it, look for certain parameters, get their values, compare them with an accepted value (or a list of them, a numeric range, …) and only if the result is as expected, test should be considered successful.

(I guess Katalon cannot read files via ssh/ftp so, to offer access to the resulting .ini I can probably expose it via http; even more, I could convert it on-the-fly to something more suitable for Katalon, if needed, like XML or JSON.)

Can this be done in Katalon? I know it can simulate browser interaction but can it also read files, parse them and compare the found values with what is given in the test case?

Thank you in advance for your answer.


Katalon uses Groovy. Groovy “is” Java. It can do all of that, and more.


Yes, you can.

You should expose your data via https://

You should convert *.ini to JSON and respond JSON back to Katalon Studio.

Then, Katalon Studio’s Web API Testing feature will be the best help for you. For example, verifying a value of a property in the Response is as simple as this:

Thank you all very much for your prompt reply and the good news!
I’ll start digging then :slight_smile:



with this pyhton code
import configparser
parser = configparser.ConfigParser()'sampleconfig.ini')
for sect in parser.sections():
   print('Section:', sect)
   for k,v in parser.items(sect):
      print(' {} = {}'.format(k,v))

ugh, not able to add Java code here, will get 403 error

ini file contents
name=John Doe
organization=Acme Widgets Inc.


I tried this in windows 10 cygwin installed.
first I created in Jidea class where used bash commands
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
import java.util.logging.Level;

public class BashRunner {

    private static final Logger log = Logger.getLogger(BashRunner.class.getName());

    public List<String> run(String command) {

        List<String> arr = new ArrayList<>();

        Runtime run = Runtime.getRuntime();

        try {
            String line= "";
            String[] env = new String[]{"PATH=C:/cygwin64/bin"};
            Process proc = run.exec(new String[] { "C:\\cygwin64\\bin\\bash.exe", "-c", command },env);
            BufferedReader br = new BufferedReader(new InputStreamReader(
            while (br.ready()) {
                line = br.readLine();
        } catch (Exception e) {
            log.log(Level.SEVERE, "failed " + command + " ", e);
        return arr;

    public List<String> getIniFile(String command1, String command2) throws IOException {

        List<String> arr = new ArrayList<>();
        arr = run( command1+" "+command2);
        return arr;
then I created artifact (.jar) file in Jidea
added it to the Katalon Drivers folder
and used it in Katalon Studio
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.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import 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.testdata.TestData as TestData
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import internal.GlobalVariable as GlobalVariable

import com.kms.katalon.core.util.KeywordUtil

import BashRunner

KeywordUtil log = new KeywordUtil()

String expectedValue = "height=176";

	List<String> arr = new ArrayList<>();
	String command1 = "less"
	String command2 = "/home/myinifile.ini"
	BashRunner bash = new BashRunner();
	arr= bash.getIniFile(command1, command2);
	String joinedString = Arrays.toString(arr);
	boolean ans = joinedString.contains(expectedValue);
	if (ans){
		System.out.println("The list contains expected value: "+ expectedValue);
		log.markPassed("The list contains expected value: "+ expectedValue)
		System.out.println("The list does not contains expected value: "+expectedValue);
		log.markFailed("The list does not contains expected value: "+expectedValue)

2019-04-21 16:54:50.373 DEBUG testcase.cygwinSsh                       - 7: arr = bash.getIniFile(command1, command2)
; Last modified 1 January 2019 by John Doe
; Example of INI File for Java
; myinifile.ini
name=John Doe
organization=Acme Widgets Inc.

2019-04-21 16:54:50.816 DEBUG testcase.cygwinSsh                       - 8: joinedString = Arrays.toString(arr)
2019-04-21 16:54:51.395 DEBUG testcase.cygwinSsh                       - 9: ans = joinedString.contains(expectedValue)
2019-04-21 16:54:51.398 DEBUG testcase.cygwinSsh                       - 10: if (ans)
2019-04-21 16:54:51.398 DEBUG testcase.cygwinSsh                       - 1: out.println("The list contains expected value: " + expectedValue)
The list contains expected value: height=176

Hi. I noticed @kazurayam addressed the inquiry, which is can this task be done in Katalon ?. So I’ll mark this as a solved issue. If further problems along the road appear then you can create a new thread so the community can focus on helping you with new problems.

Cheers !