ocrSetValue
Send a sequence of key strokes to an element. It will:
- automatically detect the element
- put focus on the field by clicking on it
- set the value in the field
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 | |
value | string | Value to be added | |
options (optional) | SetValueOptions | {} | command options |
options.clickDuration (optional) | number | 500 | Duration of the click in milliseconds |
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 | |
options.reuseOcr (optional) | boolean | false | Re-use a previous OCR scan if it is available |