FAQs listed under this topic:
13. Why WebUI.click() doesn’t click in some scenarios?
14. How to resolve WebUI keywords issues such as click(), setText(), sendKeys, and run either platforms and browsers?
15. WebUI.click keyword does not work in Safari and how to solve it?
WebUI.click() keyword sometimes is clickable and unclickable when executing the test in different environments.
Since Selenium 3, the maximum browsers are providing their respective browser drivers which implement WebDriver API. Selenium communicates to these browser drivers through HTTP commands, and these drivers speak natively with the browser. Official documentation of Selenium says:
“Selenium-WebDriver makes direct calls to the browser using each browser’s native support for automation.“
We can say that the way Chrome browser allows a click on a web element may be different from other browsers.
Also, when we click on a WebElement using Selenium WebDriver, it checks two preconditions before clicking:
1. The element must be visible.
2. It must have a height and width greater than 0.
If the preconditions are not satisfied, you will get exceptions stating the element is not clickable or interactable. Refer to the click() method in the official document here.
import com.kms.katalon.core.webui.common.WebUiCommonHelper as WebUiCommonHelper
import org.openqa.selenium.WebElement as WebElement
14. How to resolve WebUI keywords issues such as click(), setText(), sendKeys, and run tests across platforms and browsers?
- Summary: A user has an automation project expected to run across platforms and browsers. Also, the user doesn’t want to customize the keyword but uses directly the Katalon keywords.
- More detail:
The user has an automation project expected to be able to run across platforms and browsers.
These tests are being written and executed both on a co-worker’s machine (windows 10) and mine (macOS), both of us are on the latest version of the respective operating systems.
Additionally the browsers being tried are both Firefox and Chrome (latest versions as of Monday, Sept 20th)
User A and User B run the same automation project, but only User A can run the entire project successfully.
- The differences between User A and B are Test data, Platforms, and Browsers
- The User B cannot click on an element successfully even though he composes his own custom keywords below
- Web UI Enhanced Click keyword:
- Web UI sendKeys
User adds some codes to make sure the action is performed at the right timing.
The timing issue is notoriously annoying so the Smart Wait feature can be very helpful. SmartWait is enabled by default. Please make sure it is enabled.
Previously, SmartWait applied to Chrome and Firefox only. So if the users ran their tests on Edge Chromium or Headless, this could explain why they needed to do custom scripts. In 8.2.0, we support Smart Wait on Edge Chromium and make it wait for Fetch APIs. So if their website is using Fetch API, SmartWait can be of great help.
WebUI.click is not working with Safari 13.1 version when trying to run on SauceLabs virtual machine.
How would you rate this FAQ topic from 1 to 5?
Katalon Community technical FAQs are about common customer technical issues when using Katalon products. We filter these on our Helpdesk Portal twice every month to help Forum users get an easy approach to the solutions to similar problems.
If you’re paid customer, you can easily submit a ticket to our dedicated Support team.
Haven’t got your concern tackled - leave it here!