feat: tap the first one matches text from given texts by ocr

This commit is contained in:
xucong.053
2022-10-11 14:53:21 +08:00
parent 0ff5fb762f
commit cd0ab6dfdb
12 changed files with 485 additions and 29 deletions

View File

@@ -693,7 +693,7 @@ func (ud *uiaDriver) Input(text string, options ...DataOption) (err error) {
}
var element WebElement
if valuetext, ok := data["text"]; ok {
if valuetext, ok := data["textview"]; ok {
element, err = ud.FindElement(BySelector{UiAutomator: NewUiSelectorHelper().TextContains(fmt.Sprintf("%v", valuetext)).String()})
} else if valueid, ok := data["id"]; ok {
element, err = ud.FindElement(BySelector{ResourceIdID: fmt.Sprintf("%v", valueid)})