Ocr click if number us greater than

92 views
Skip to first unread message

Habib Rehman

unread,
Jul 27, 2023, 4:54:14 PM7/27/23
to Automate
How can I click on a number that is greater than 5000 when it's shown on the screen, such as 5500 and 5900? When the number is equal to 5000, it's easy to click on it using the interact and click event, but how can I click on a number that is greater than 5000? I've tried using the autoinput tools but it only clicks on the exact number, not the larger number."

Henrik "The Developer" Lindqvist

unread,
Jul 28, 2023, 8:56:01 AM7/28/23
to Automate
Example:
//android.widget.Button[number(@android:text) > 5000]

Habib Rehman

unread,
Jul 30, 2023, 4:42:24 PM7/30/23
to Automate
Actually the text is like 5000AB
So it is there any possibility to remove alphabet from xpath, or you can provide xpath which contains alphabet and numerical 

Henrik "The Developer" Lindqvist

unread,
Jul 31, 2023, 5:30:02 AM7/31/23
to Automate
If it's always two characters at the end then try:
//android.widget.Button[number(substring(@android:text, 1, string-length(@android:text)-2)) > 5000]


Otherwise try:
//android.widget.Button[number(translate(@android:text, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', '')) > 5000]

See: https://www.w3.org/TR/1999/REC-xpath-19991116/#function-translate
Reply all
Reply to author
Forward
0 new messages