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 Summary
Constructors Constructor Description FileContentsValidator(String filePath, boolean shouldPrintFileContentsOnConsole)FileContentsValidator(String filePath, boolean shouldPrintFileContentsOnConsole, String ocrLanguage)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringextractFileContents()static voidmain(String[] args)FileContentsValidatorvalidateAllKeywordsPresent(String... keyWords)Validates all keywords are presents, order does not matter.FileContentsValidatorvalidateAllKeywordsPresentInOrder(String... keyWords)Validates all keywords are presents in the same order as given in arguments.FileContentsValidatorvalidateAtLeastNKeywordPresent(int atLeastN, boolean inOrder, String... keyWords)
-
-
-
Method Detail
-
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)
-
-