I am working on automation testing using Selenium java. For my scenario first opening the login page and after providing credentials and clicked Login button current browser (with login page) closes and a new IE window open with Home page. In java code I am getting the driver with login page url and from there providing username and pwd then click on login page working fine, but after that as the page closes and new IE window opened while I am trying to work on the home page I am getting noSuchWindowException or Null handle like these. Can you help me in getting the new window handle for Home page?
My codes are like below:
...
System.setProperty("webdriver.ie.driver", pathToDriver);
driver = new InternetExplorerDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("<Login Page URL>");
driver.findElement(By.id("userName")).sendKeys("Admin");
driver.findElement(By.id("password")).sendKeys("Admin");
driver.findElement(By.className("loginButton")).click();
driver.get("<Home Page URL>");
...
Thanks,
Surodip
driver.get("<Home Page URL>");?