I have the following code:
def xpath = '//*[matches(@id,\'MessageList_DXDataRow[0-9]+\')]/td[text()=\'' + GlobalVariable.SearchData + '\']' TestObject testObject = new TestObject() testObject.addProperty("xpath", ConditionType.EQUALS, xpath) WebUI.delay(2) WebUI.click(testObject)
For some reason it can’t click on the testObject. I have tested my xpath with an xpath validator online and it was working with static data. ( I just copied the variable-substitued xpath expression and pasted it into the validator. )
I have also added the following line of codes after the above mentioned codes:
I get the following error message:
com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: '' located by 'By.xpath: //*[matches(@id,'MessageList_DXDataRow[0-9]+')]/td[text()='F-03836/2020']' not found at
Is there anything that i’m missing here?