Class OCR

  • All Implemented Interfaces:
    OCR

    @Component
    @Primary
    public class OCR
    extends Object
    implements OCR
    OCR (Optical character recognition) capabilities (using Tesseract)

    http://tess4j.sourceforge.net

    • Constructor Detail

      • OCR

        @Autowired
        public OCR​(net.sourceforge.tess4j.Tesseract ocr)
    • Method Detail

      • getText

        public String getText​(org.openqa.selenium.WebElement element)
        Parameters:
        element - WebElement element to perform OCR on
        Returns:
        recognised text of the element
      • getText

        public String getText()
        Returns:
        all text recognised on the screen
      • withDriver

        public OCR withDriver​(org.openqa.selenium.WebDriver driver)
        Usage:
         new OCR().withDriver(driver);
         
        Parameters:
        driver - WebDriver to use for capturing screenshots
        Returns:
        this
      • withDriver

        public OCR withDriver​(org.openqa.selenium.TakesScreenshot driver)
        Usage:
         new OCR().withDriver(driver);
         
        Parameters:
        driver - TakesScreenshot to use for capturing screenshots
        Returns:
        this
      • setDriver

        public void setDriver​(org.openqa.selenium.WebDriver driver)
        Specified by:
        setDriver in interface OCR