ocrWaitForTextDisplayed
Wait for a specific text to be displayed on the screen.
Usage
await browser.ocrWaitForTextDisplayed({
text: "specFileRetries",
});
Output
Logs
[0-0] 2024-05-26T04:32:52.005Z INFO webdriver: COMMAND ocrWaitForTextDisplayed(<object>)
......................
# ocrWaitForTextDisplayed uses ocrGetElementPositionByText under the hood, that is why you see the command ocrGetElementPositionByText in the logs
[0-0] 2024-05-26T04:32:52.735Z INFO @wdio/ocr-service:ocrGetElementPositionByText: Multiple matches were found based on the word "specFileRetries". The match "specFileRetries" with score "100%" will be used.
Options
text
- Type:
string
- Mandatory: yes
The text you want to search for to click on.
Example
await browser.ocrWaitForTextDisplayed({ text: "specFileRetries" });
timeout
- Type:
number
- Mandatory: no
- Default: 18000 (18 seconds)
Time in milliseconds. Be aware that the OCR process can take some time, so don't set it too low.