I am unable to switch between windows. Cursor got struck on opening the popup. Unable to move any further. Test case: Open the URL: http://voltaerp.cloudapp.net/VomsDemoV2/ Click on Enquiries tab and then click on sub menu item “Foreign enquiry”. This will redirect the user to foreign enquiry page. Now click on the green plus symbol + to select an item from the POP-UP. I am good till now. Once the window opens the code gets stuck. Unable to read the ID of the Pop-up or switch the driver to pop-up so that I can select any item. Please help
This the code I used
Public void main (string[]args)
{
WebDriver driver=new FirefoxDriver();
driver.get(“voltaerp.cloudapp.net/VomsDemoV2/");
driver.findElement(By.id("txtUser")).clear();
driver.findElement(By.id("txtUser")).sendKeys("testmail_b@yahoo.com");
Thread.sleep(500);
driver.findElement(By.id("txtPass")).clear();
driver.findElement(By.id("txtPass")).sendKeys("123456");
driver.findElement(By.id("btnLogin")).click();
driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
WebElement parentlink= driver.findElement(By.id("ctl00_NavigationMenun3"));
Actions hover= new Actions(driver);
hover.moveToElement(parentlink).build().perform();
WebElement sublink= driver.findElement(By.linkText("FOREIGN ENQUIRY"));
Actions Fe= new Actions(driver);
Fe.moveToElement(sublink).click().build().perform();
driver.findElement(By.id("ctl00_ContentPlaceHolder1_gv_itms_ctl03_imgbtnAddItem")).click();
//Unable to move further. cursur is not going to next statement when I am debugging the code.
Set<String> WindowIds = driver.getWindowHandles();
Iterator<String> itr = WindowIds.iterator();
String mainwindow = itr.next();
String Popup = itr.next();
driver.switchTo().window(Popup);
driver.findElement(By.xpath(".//*[@id='txtItmDscrip']")).sendKeys("TESTITEM");
}