Skip to main content
1 of 3

I had exactly the same issue some time ago. I was waiting for content of gxt window to be loaded and many times I failed because of timeout exception. Normally window was loading content about max 5 sec, but with WebDriver even 30 minutes was not enough. What I found was that timeout happened because of WebDriver was causing DOM not to be properly loaded (freezing). As a workaround I have found that simple window re-size is enough. Probably your problem was already solved, but i put this to others that can face the same issue in the future.

Below there is method code to make your code cleaner.

I'm always putting commonly used methods in some special class to not duplicate code lines.

public static void browserShake(WebDriver driver, int x, int y, int width, int height) {

    driver.manage().window().setSize(new Dimension(width+50, height));
    driver.manage().window().setSize(new Dimension(width, height));
  
}