OCR Built-ins¶
OCR Built-ins invoke Tesseract OCR commands. For more information about Tesseract, refer to the tesseract github repository.
Configuration
1 2 3 4 5 6 7 8 | OCRConfigurations { myOcrCommand1 { commandLineParametersFormat = <String> executableSuffix = <String> timeoutSeconds = <Number> } ... } |
Parameters
-
commandLineParametersFormat - The format of the Command Line
- Detailed information can be found here
-
executableSuffix - Can be configured if the Tesseract Command needs to have a suffix like
.exe
- This is usually needed on Windows operating systems
-
timeoutSeconds - This is the maximum amount of time that the command should wait
- If this timeout is reached, the Tesseract Command will be canceled and the test case will fail
Example
1 2 3 4 5 6 7 | OCRConfigurations { myOcrCommand1 { commandLineParametersFormat = "param1 %s param2 %s" executableSuffix = ".exe" timeoutSeconds = 90 } } |
When OCR Built-ins are configured, the following OCR command can be executed.
Syntax
1 | Ocr.ocr(<configurationKey String>, [<dynamicParameters String, ...>]) |
Parameters
-
configurationKey -The name of the configuration used in
OCRConfigurations
-
dynamicParameters - The parameters that will be appended to the tesseract command according to the
commandLineParametersFormat
configuration
Example
1 | Ocr.ocr("myOcrCommand1", ["param1Value", "param2Value"]) |
This will result in the following execution with a timeout of 90 seconds:
1 | tesseract.exe param1 param1Value param2 param2Value |