Hi,
In my application I’m clicking on some link and it is openeing a PDF file embedded in the browser(new window/Tab).
I’m using getCurrentURL to fetch the url value for validation once switching to the PDF window.
In chrome and FF it is working prefectly, but on IE it is not working.
For all the functions I used on the new window with the embedded PDF:
getCurrentUrl
geTitle
getPageSource
I was getting empty values in IE.
I have aslo tried using JavascriptExecutor but got exception: Java script error (again same worked on FF and Chrome)
Did anyone faced same/similar issue?
IE8
FF 17.02
Selenium 2.35
Thanks Dina.
public void testUntitled() throws Exception {
driver.get(baseUrl + "/english/investments/iv_funds.htm");
Set<String> winids = driver.getWindowHandles();
Iterator<String> iterate = winids.iterator();
Thread.sleep(3000);
driver.findElement(By.linkText("FUND MATERIALS")).click();
Thread.sleep(3000);
driver.findElement(By.className("sbToggle")).click();
Thread.sleep(3000);
driver.findElement(By.linkText("Fund Details and Performance Update")).click();
driver.findElement(By.id("fundPerformance")).click();
driver.findElement(By.id("fundPerformance")).clear();
driver.findElement(By.id("fundPerformance")).sendKeys("AEGAU");
Thread.sleep(3000);
driver.findElement(By.xpath("//*[@id='perform']")).click();
Thread.sleep(18000);
winids = driver.getWindowHandles();
iterate = winids.iterator();
String firstwindow=iterate.next();
String secondwindow = iterate.next();
System.out.println(firstwindow);
System.out.println(secondwindow);
driver.switchTo().window(secondwindow);
Thread.sleep(3000);
System.out.println("url is"+driver.getCurrentUrl());
driver.close();
}
Thanks,
Eliyas Praveen