The message “com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id:... not found” implies 2 possible cases:
- The locator is right but your code tries to get access to the WebElement in a web page too soon when the WebElement is not yet visible in the browser. So that you test code fails to find the WebElement in the page.
- The locator (xpath or css selector) is wrong; it points no WebElement present. It will fail anyway regardless timing.
@grylion54 thought of the case 1. So he advised to you to let your test code wait for the WebElement becomes present and visible. Why not you give his suggestion a chance? Please try it.
Concerning the probability of the case 2, I do not see anything. If we are to check the locator’s validity, we need more information to be shared, such as:
- how your target HTML source looks like. If the target URL is publicly accessible, then share it to us. If not, make a zip of HTML and publish it here.
- how your test case code calls
findTestObject(testobject) - how your test object is defined
- when executed what locator you expect to be generated by the
findTestObject() - when executed what locator you actually got
But checking the xpath validity remotely is often difficult in the forum discussion format.
I would rather suggest you to create a simpler test case which just calls:
WebUI.openBrowser(yourURL)
WebUI.verifyElementPresent(findTestObject(testObjectName, params), 10)
This code would make you concentrated to a single issue: if the xpath generated by findTestObject is right or wrong.