mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
return the first one matched exactly when index not specified
This commit is contained in:
@@ -134,6 +134,11 @@ func (t OCRTexts) FindText(text string, options ...ActionOption) (result OCRText
|
||||
}
|
||||
|
||||
results = append(results, ocrText)
|
||||
|
||||
// return the first one matched exactly when index not specified
|
||||
if ocrText.Text == text && actionOptions.Index == 0 {
|
||||
return ocrText, nil
|
||||
}
|
||||
}
|
||||
|
||||
if len(results) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user