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
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)
-
Constructor Details
-
FileContentsValidator
-
FileContentsValidator
-
-
Method Details
-
validateAllKeywordsPresent
Validates all keywords are presents, order does not matter.- Parameters:
keyWords-- Returns:
-
validateAllKeywordsPresentInOrder
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
-
main
-