Selenium 2.0b3 IE WebDriver, Click not firing

后端 未结 18 1951
我寻月下人不归
我寻月下人不归 2020-11-29 02:33

When using the IE driver with IE9, occasionally the Click method will only select a button, it wont do the action of the Click(). Note this only happens occasionally, so i d

18条回答
  •  臣服心动
    2020-11-29 03:08

    My solution was:

    Selenium WebDriver 2.29.0 (JAVA), TESTED with FF16 and IE9

    Before to make a findElement, I did a maxime browser screen. It works fine.

    public void maximeBrowser() {
            Toolkit toolkit = Toolkit.getDefaultToolkit();
            Dimension screenResolution = new Dimension((int)toolkit.getScreenSize().getWidth(), (int)toolkit.getScreenSize().getHeight());
    
            //Maximize the browser
            logger.info("Maximizing the browser : getWidth ["+screenResolution.getWidth()+"] - getHeight ["+screenResolution.getHeight()+"]");
            getDriver().manage().window().maximize();
        }
    

提交回复
热议问题