← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #691094]: Extracting text from the image

 

Question #691094 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/691094

Kogul gave more information on the question:
Here is the below-updated code: Currently am experimenting sikuli with
selenium. I'm doing UI automation. In this case, I need to extract a
text from a matching image that is present on the screen.  Please find
the updated code so far I researched and found an update still am not
able to extract a text from an image using Sikuli. Can anyone here help
me in resolving this issue?.

When I run this code I find this text printed on the console.

[error] TextRecognizer: init: export tessdata not possible - run setup with option 3
[error] TextRecognizer not working: tessdata stuff not available at:
C:\Users\user\AppData\Roaming\Sikulix\SikulixTesseract\tessdata
[error] text: text recognition is now switched off
--- no text ---


public class practice {

        public static void main(String[] args) throws FindFailed {


		Settings.OcrTextSearch=true;
		Settings.OcrTextRead=true;

                WebDriverManager.chromedriver().setup();

		WebDriver driver = new ChromeDriver();
		driver.get("http://demo.automationtesting.in/Register.html";);
		driver.manage().window().maximize();
		driver.manage().timeouts().implicitlyWait(1000, TimeUnit.SECONDS);

                WebElement button =
driver.findElement(By.xpath("//*[@id='imagesrc']"));

		Actions d = new Actions(driver);
		d.moveToElement(button).click(button).build().perform();

		Screen src1 = new Screen();
		src1.find("textinput.PNG");
		src1.wait("textinput.PNG", 20);
		src1.type("textinput.PNG", "Test");

	
	Region reg=src1.find("C:\\Users\\user\\eclipse-workspace\\sikuli\\images\\Open.PNG");
	String str=reg.text();
	
	System.out.println(str);
		
	}
}

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.