How to add Java files to Katalon studio or change the prefered language to java

Hi

Is it possible to change the language preference in Katalon studio from groovy to java?

Im using some methods from the twitter4j library and one of the methods use a do…while and groovy does not support this hence why the question is being asked.

Thank you.

I only got the answer for this…we just need to copy any paste the import files.

Ex:-import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

like this i have added all the libraries and it is working.

1 Like

You said that katalon can work with Java also ,then how to add the library ???

Hi there,

I don’t think you can change the internal library of Katalon Studio to Java.

And you’re right about Groovy not supporting do while method.

However, Groovy do support while method, and I believe that you can always convert a do while loop to a while loop.

You can try to convert your code to use a while loop or post your code here so that I can help you do it.