I have a button click command in Katalon Studio where I use scrollIntoView to bring a button into view and then click the button.
((JavascriptExecutor) functiondriver).executeScript("arguments[0].scrollIntoView({block: \"nearest\"});", buttonelement);
WebUI.delay(4)
WebUI.click(findTestObject('object/path'))
Using Chrome on execution, the code works fine on a Windows computer, but then on a Mac computer I get the following error about 40% of the time:
Unable to click on object '/object/path/' (Root cause: org.openqa.selenium.WebDriverException: unknown error: Element <button class="classname">...</button> is not clickable at point (750, 548). Other element would receive the click: <html lang="en">...</html>
I looked around the web for solutions and attempted to solve this by adding the delay you see above, but that didn't work. Furthermore, when looking at the browser as the automation was running, I can visually see the button that is supposed to be clicked - so it is not like the button is not loading. Is there another way I can write this code so that it works more consistently?
Update: I have tried the more intelligent wait function suggested both in this answer and the related question, but neither worked. I would like to stress that this problem only occurs on Mac machines, not Windows; this is what makes this problem different from other similar questions.
I did make a discovery. When running the script via Katalon Studio, Chrome by default does not maximize the window. However, I did an experiment where I forced the browser to maximize and that solved the problem. So it seems that Katalon Studio is having trouble setting x,y coordinates on a Mac when the browser is not full screen. Is this some sort of calibration issue with my install or known behavior with WebUI on Mac machines?