I’m using
Selenium standalone server – 2.25.0
IE – 8.0.7601.17514 (64 – bit edition)
IEDriverServer.exe – 2.28.0 (64-bit)
OS – Windows 7 professional
Java – SDK7
I’m using below code to launch IE and run a simple test.
WebDriver driver = null;
DesiredCapabilities ieCapabilities = null;
ieCapabilities = DesiredCapabilities.internetExplorer();
if (ieCapabilities != null) {
driver = new InternetExplorerDriver(ieCapabilities);
}
driver.get("http://www.yebhi.com/");
// driver.findElement(By.id("anchSighin")).click();
driver.findElement(By.xpath("//div/ul/li/a/div/span")).click();
driver.findElement(By.xpath("//div[80]/a")).click();
driver.findElement(By.xpath("//div[4]/div/div[2]/div/div[4]/a"))
.click();
Thread.sleep(5000);
driver.findElement(By.xpath("//div[5]/div[4]/div/div[4]/a")).click();
driver.switchTo().frame(2);
driver.findElement(By.id("txtMoblogin")).clear();
driver.findElement(By.id("txtMoblogin")).sendKeys("ghfghghf");
driver.findElement(By.id("txtMobPass")).clear();
driver.findElement(By.id("txtMobPass")).sendKeys("hfghgh");
Thread.sleep(5000);
driver.findElement(By.id("btnLogin")).click();
By using above code i was able to launch and run the test, but with a problem.
The actual problem is the browser is continuously maximizing and minimizing until the test suite get finished.
I am struggling with this issue for more than a week. I don’t know weather it is a bug or not. If it is a bug please resolve me.
Thanks in advance.
The IE driver is resizing the IE window because you are taking screenshots. It WebDriver, screenshots are, by definition, of the full page. However, in order to take a screenshot of the full page without scrolling (which would screw up absolutely positioned elements), you have to be able to render the full page in IE. The only way to get the full page to render is to resize the IE window so that the full page is visible without scrolling. So, the IE driver does the resize automatically for the screenshot API call, then restores the window to the state it was in before the call.