0
votes

We've been build a site for quite a while and I am implementing UI UnitTesting.

It relies heavily on overlaying buttons with "proxies" to allow for more capabilities like dragging from one iframe into another. From a testing perspective, I want/need to "click" the button. It should click the proxy element overlaid on it. Then the test can continue. This works in IE and even Chrome, but when we went to test on the Build Server it failed with the error

threw exception: System.InvalidOperationException: unknown error: Element is not clickable at point (265, 87). Other element would receive the click: div class="v-iframe-proxy" style="width: 100%; height: 100%;" /div

I am hoping there is a way to ignore this condition and click anyway. Any help would be awesome.

2

2 Answers

2
votes

I believe that you have 3 options here: 1. Perform click using JavaScript like this:

((JavascriptExecutor) webdriver).executeScript("arguments[0].click()", elementToClick);
  1. Try to click using new Actions(webdriver).click().build().perform();
  2. Surround your click with try catch and continue execution.
0
votes

I think that your UI tests work on headless browser in the server side. So you need to set width and height initially.

If you print size of the window, you'll see: 0,0

System.out.println(driver.manage().window().getSize());

So you can set window's size as 1024x600 (or whatever you want):

Dimension d = new Dimension(1024,600);
driver.manage().window().setSize(d);