Class FileContentsValidator

java.lang.Object
org.uitnet.testing.smartfwk.validator.FileContentsValidator

public class FileContentsValidator
extends Object
This file is used to validate the file contents in different file formats like .docx, .xlsx. .pdf etc.. Note: tesseract should be installed on the system. Please refer following link to install Tesseract on different platforms: https://tesseract-ocr.github.io/tessdoc/Installation.html
Author:
Madhav Krishna
  • Constructor Details

    • FileContentsValidator

      public FileContentsValidator​(String filePath, boolean shouldPrintFileContentsOnConsole)
    • FileContentsValidator

      public FileContentsValidator​(String filePath, boolean shouldPrintFileContentsOnConsole, String ocrLanguage)
  • Method Details

    • validateAllKeywordsPresent

      public FileContentsValidator validateAllKeywordsPresent​(String... keyWords)
      Validates all keywords are presents, order does not matter.
      Parameters:
      keyWords -
      Returns:
    • validateAllKeywordsPresentInOrder

      public FileContentsValidator validateAllKeywordsPresentInOrder​(String... keyWords)
      Validates all keywords are presents in the same order as given in arguments.
      Parameters:
      keyWords -
      Returns:
    • validateAtLeastNKeywordPresent

      public FileContentsValidator validateAtLeastNKeywordPresent​(int atLeastN, boolean inOrder, String... keyWords)
    • extractFileContents

      public String extractFileContents()
    • main

      public static void main​(String[] args)