Hi
I have created the following keyword: @Keyword
def click(String testObject){
WebElement element = WebUiCommonHelper.findWebElement(findTestObject(testObject),30)
WebUI.executeJavaScript("arguments[0].click()", Arrays.asList(element))
}
I have been using it on multiple objects throughout my application to click on items and everything works just fine. Recently, I tried to use it to click on certain menu drop-down items, but for some reason it won’t make a click.
The log says that the step is PASSED and so my test fails on the next step because obviously it really didn’t click on the item. When I watch the test case being executed in browser, I can also see that there is in fact no click being made although the log says that it PASSED and so it fails on the next step.
Clicking on the menu item works with WebUI.click() command in browser mode, but I cannot use it because, when running my test headless with Task Scheduler, it gives me the other element would receive click error.
Overall, changing the window size in headless resolved my problem. Thank you for that!
Still wondering tho, why doesn’t the JavaScript method actually make the click even though it says it does. The same TestObject works fine with WebUI.click().