I want to create a dynamic test object.
Here's my test object's xpath:
(.//*[normalize-space(text()) and normalize-space(.)='${username}'])[1]/following::span[1]
I want to replace ${username}
dynamically in my script. Here's what i've tried:
WebUI.verifyElementPresent(findTestObject('Page_CICIL_adminDashboard/span_Dash', [('username'):varEmail]), 3)
but it throws element not found
like this:
com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: 'Object Repository/Page_CICIL_adminDashboard/span_Dash' located by 'By.xpath: (.//*[normalize-space(text()) and normalize-space(.)='${username}'])[1]/following::span[1]' not found)
Looks like the ${username}
variable wasn't replaced by my value correctly.. can you please suggest how to do it correctly?