Difference between WebUiBuiltInKeywords.findWebElement(to) and WebUiCommonHelper.findWebElement(to,int timeOut)

When I want to click on the element

def clickElement(TestObject to) {
WebElement element = WebUiBuiltInKeywords.findWebElement(to);
KeywordUtil.logInfo(“Clicking element”)
element.click()
KeywordUtil.markPassed(“Element has been clicked”)
}

I am using the above method.

Instead of WebUiBuiltInKeywords, If am using WebUiCommonHelper.findWebElement(to, int timeout). I am unable to click on the element

What is the difference between this?

When I am checking the methods in WebUiBuiltInKeywords class there is no findWebElement method. But while executing the script it still works.

Could someone help me with this please,

Basically, Katalon deals with TestObjects, Selenium deals with WebElements (mostly) and the various APIs and classes you mention are supposed to help you move seamlessly between them.

<sarcasm>
As for the difference, they do different things on different sides of the same coin. A bit like the difference between a broken leg and a broken arm. They both hurt.

Forgive me while I roll my eyes here a moment :roll_eyes:
</sarcasm>

Fact is, you don’t need any of this stuff to do testing. Well, okay, if you follow the advice as laid down in the docs, you need them. Or, if you build your tests using the spy tool etc, you’ll need them.

I’ll shut up now and let someone else chime in (with, hopefully, something more useful than my opinionated rant :stuck_out_tongue:).

1 Like

I cannot think of any reason why an instance of the WebElement would not be clickable between the two. To test this, I would run this code in Debug, and compare the two instances of the WebElement to look for differences:

def clickElement(TestObject to) {
   // first approach
   WebElement element1 = WebUiBuiltInKeywords.findWebElement(to);
   
   // second approach
   WebElement element2 = WebUiCommonHelper.findWebElement(to, 30);
}