Is there any ability to emulate the mouse down/up events?

My issue is that I can’t hold the click action at the object for a few seconds to know that the result of this action applied exactly at mouse up and not mouse down events. In documentation I couldn’t find any appropriate ways to do this. Will be happy to get any advise

You can try using the Keyword “Execute Javascript” and use something like this :

document.getElementById('ITEM_ID').dispatchEvent(new Event('mousedown'));
1 Like

Selenium has a utility for this:

import org.openqa.selenium.interactions.Actions
import com.kms.katalon.core.webui.common.WebUiCommonHelper

Actions actions = new Actions(DriverFactory.getWebDriver());
WebElement element = WebUiCommonHelper.findWebElement(“path/to/my/object”, 30);
actions.clickAndHold(element).perform();
actions.release(element).perform();

You would just need to provide the path to your test object in the above code, as it needs to be converted to a WebElement object. The “clickAndHold” method simulates pressing down the left mouse button, and the “release” method simulates, well, you know… :slightly_smiling_face:

3 Likes

Thanks guys!

1 Like