ocrGetElementPositionByText
Get the position of a text on the screen. The command will search for the provided text and tries to find a match based on Fuzzy Logic from Fuse.js. This means that if you might provide a selector with a typo, or the found text might not be a 100% match it will still try to give you back an element. See the logs below.
#
Usage#
Logs#
OptionsName | Type | Default | Details |
---|---|---|---|
selector | string | The visual name of the field | |
options (optional) | GetTextOptions | {} | command options |
options.reuseOcr (optional) | boolean | false | Re-use a previous OCR scan if it is available |
options.androidRectangles (optional) | Rectangles | Rectangles for Android to crop the search area for OCR | |
options.androidRectangles.top | number | Start position from the top of the screen to start cropping the search area for OCR | |
options.androidRectangles.left | number | Start position from the left of the screen to start cropping the search area for OCR | |
options.androidRectangles.right | number | Start position from the right of the screen to start cropping the search area for OCR | |
options.androidRectangles.bottom | number | Start position from the bottom of the screen to start cropping the search area for OCR | |
options.iOSRectangles (optional) | Rectangles | Rectangles for Android to crop the search area for OCR | |
options.iOSRectangles.top | number | Start position from the top of the screen to start cropping the search area for OCR | |
options.iOSRectangles.left | number | Start position from the left of the screen to start cropping the search area for OCR | |
options.iOSRectangles.right | number | Start position from the right of the screen to start cropping the search area for OCR | |
options.iOSRectangles.bottom | number | Start position from the bottom of the screen to start cropping the search area for OCR |
#
ReturnsReturns the search value, the matched text, and the position of the element on the screen