I recorded a simple login script and when I used the WebUiCommonHelper to store the webelements in a variable (screenshot), the script failed to run. I am not sure what is it that I’m doing wrong. May someone assist?
Note: if I use WebUI.setText(findTestObject(‘Object Repository/Page_eCOIDA - Powered by CompSol/input_Username_username’), ‘mzulu’) the script runs fine. The issue here seems to be WebUiCommonHelper because even if I do not call or use the variables the script doesn’t run until remove/comment out the WebUiCommonHelper statements.
WebUI.findWebElement() takes in a TestObject and returns a Selenium WebElement. On the other hand, findTestObject() expects a string representing the path of a test object’s ID. This is why using:
works.
In your script, you’re passing userPassword which is a Selenium WebElement into findTestObject, therefore the exception says that there’s no method with the name findTestObject that accepts such an argument.