I’m having difficulties trying to verify text content that ‘contains’ the text I’m trying to verify. I’ve tried various ‘substring’ and ‘regex’ solutions on this forum but nothing seems to work. For example…
Using substring, I’m trying to verify that the Priority field contains / ends with the word ‘(Critical)’. I see something like ‘Before 21/07/2020 16:34 (Critical)’ in the app. Here’s my script…
def Priority = Mobile.getText(findTestObject('Priority FIELD'), 0)
Priority = Priority.substring(result.length() - 10)
Mobile.verifyMatch(Priority, '(Critical)', false, FailureHandling.CONTINUE_ON_FAILURE)
The logs show the following:
Unable to verify match between actual text ‘Before 21/07/2020 16:34 (Critical)’ and expected text ‘(Critical)’ (Root cause: com.kms.katalon.core.exception.StepFailedException: Actual text ‘Before 21/07/2020 16:34 (Critical)’ and expected text ‘(Critical)’ are not matched
Any suggestions for how I can achieve this please? Thanks