import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Iframe {
public static void main(String[] args) throws Exception{
WebDriver driver=new FirefoxDriver();
try{
driver.get("http://www.timesjobs.com/candidate/logout.html");
driver.manage().window().maximize();
driver.findElement(By.xpath("//li[1][@class='bdr-left']/a")).click();
//Once the button is clicked a window is open and when i checked it says that its a iframe
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
WebElement wb=driver.findElement(By.xpath("iframe[@id='GB_frame1']"));
driver.switchTo().frame(wb);
System.out.println("Frame Name ="+driver.getTitle());
driver.switchTo().defaultContent();
System.out.println("Current Page Is "+driver.getTitle());
}//try
catch(Exception e){
e.printStackTrace();
driver.close();
driver.quit();
}//catch
finally{
driver.close();
driver.quit();
}//finally
}//main
}//class
Here i am trying to send some value in the login id feild but when i am clicking ti signin button a popup opens. When i right click on the popup then i got a option which says that THIS FRAME then i come to know that its a frame. I tried to switch to it by using driver.switchTo().frame(wb); where wb is having the path of the frame. When i run the code i got NOSuchElement exception for the loginid feils which means the webdriver is not able to pass the control to the frame.
How can i solve this?