I am migrating our Robot framework tests from Selenium library onto Playwright library. And i am stuck in one message validation of a text message which contains unique incident ID every time, so while validating the success message i want to ignore the incident ID part but need to validate the rest of the text. So for this purpose in selenium i was using “Should Contain” which was working fine but for Playwright i tried using “contains” as well as “*=” but it is not working as expected. Here is what i am doing:
${Text} = This is success message
${SuccessfulMessage} Browser.Get Text ${Locator} contains ${Text}
When i do Log ${SuccessfulMessage} it is giving me This is success message 11-222-333
Probably because when i doing Browser.Get Text ${Locator} , it is fetching the whole text message with incident ID and comparing the same with ${Text}, and getting failed.
How can i resolve this ? I can provide you all other details if required.