It Possible to take screen shot and than read the text present in that image and compere that text

Is it Possible to take a screenshot and then read the text present in that image and compare that text?

yes, try to look on SIKULI


yes, i have done java libs for that, but need to wait to get katalon works again, license issue :slight_smile:

found my keywords from github

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;

import internal.GlobalVariable

public class readImage {

public String readImageText(String imPath){

	String imagePath = imPath;
	com.image.txt.GetImageText image = new com.image.txt.GetImageText();
	String res = image.getImageText(imagePath);
	return res;

public BufferedImage resized(BufferedImage bufImage,int x, int y){
	com.image.txt.GetImageText image = new com.image.txt.GetImageText();
	BufferedImage resized = image.scaleImage(bufImage, x, y);
	return resized;

public BufferedImage convert(BufferedImage bufImage){
	com.image.txt.GetImageText image = new com.image.txt.GetImageText();
	BufferedImage convert = image.convertImage(bufImage)
	return convert;


Hi @Timo_Kuisma1

I am getting the below error. What java libs have you used? Thanks …



these libs are needed to import, download .jar from the web and add to the project Drivers folder, restart Katalon Studio

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;


Thanks for your prompt reply.

These libs are available in Katalon by default. image

Please tell, what is this? – com.image.txt.GetImageText


sorry my typo, this is needed also
import com.image.txt.GetImageText

this .jar is needed to add project Drivers folder

Hi @Timo_Kuisma1 Could you please share this Jar file, or the download link. I couldn’t get this JAR file in google… :face_with_head_bandage:



imageTxt.7z (3.6 MB)

Thanks Timo… Is there any dependency jar files required. Since my script is failing. Getting the below error. I have added the libtesseract304 but still failing.

java.lang.UnsatisfiedLinkError: Unable to load library 'libtesseract304':


yeah there are lot of more libs, but cannot paste here more than 4KB size attachment

check the size from my image 76 156 kt

This solution worked for me:
import net.sourceforge.tess4j.;
import net.sourceforge.tess4j.util.
import static org.junit.Assert.*;

public class TesseractUtil {

 * First install Tesseract installer for Windows from (tesseract-ocr-w64-setup-v5.2.0.20220712.exe (64 bit))
 * Add tess4j-5.4.0.jar from
 * Add all 9 Compile Dependencies
 * For other language support add .traineddata in C:\Users\SMO_AJ~1.VM-\AppData\Local\Temp\tess4j\tessdata
 * Issue: Conflict because jna and jna-platform jar files have different versions in Katalon(4.1.0) and Tess4j (5.3.1).
 * Workaround: In katalon jan and jna-plateform jar are replaced with 5.3.1.
def void readImageText(String fileName){

	ITesseract instance = new Tesseract(); // JNA Interface Mapping

	 * You either set your own tessdata folder with your custom language pack or
	 * use LoadLibs to load the default tessdata folder for you.
	//		System.setProperty("jna.library.path", "D:/Katalon/ks_enne_tps_autotests/Drivers/jna-5.3.1.jar");
	File tessDataFolder = LoadLibs.extractTessResources("tessdata");
	String dataPath = tessDataFolder.getAbsolutePath(); // point to "C:\Users\SMO_AJ~1.VM-\AppData\Local\Temp\tess4j\tessdata"

	File imageFile = new File(fileName);

	try {
		//System.setProperty("jna.library.path", "D:/Katalon/ks_enne_tps_autotests/Drivers/jna-5.3.1.jar");
		String result = instance.doOCR(imageFile);
	} catch (Throwable e) {