I’m struggling with extracting text via GetText Keyword. After using GetText I have 5 words extracted from Object, and I need to get only second one. I cannot use substring option as this word have different length each time.
At the beginning I’m declaring new variable:
String selectedChannelName = WebUI.getText(findTestObject(randomChannel))
after that some part of test is going on, and after opening new menu I need to verify that text which contains name is the same one as stored in
selectedChannelName variable. So I’m getting name of new element in other menu:
String displayedChannelname = WebUI.getText(findTestObject('Object Repository/xxxx/xxx/xxx/xxx/xxx/div_channelAddedToPackage'))
and then I need to use previously obtained name from 1st menu:
WebUI.verifyMatch(displayedChannelname, selectedChannelName, false)
But in logs I have stack that name does not match as I have much more text extracted in selectedChannelName.
xxx/xxxx/xxx/xxx/xxx/Add a new service group FAILED.
com.kms.katalon.core.exception.StepFailedException: Actual text ‘Channel 3’ and expected text ‘SD
No’ are not matched
I need to extract “Channel 3” name (it may have different length each time)? Maybe it is possible to extract it to some kind of a list?