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;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

public class Frame {

public static void main(String[] args) {

WebDriver driver = new FirefoxDriver();
//driver.manage().window().maximize();
driver.navigate().to(“https://www.zoho.com/crm/lp/login.html”);
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
WebElement ifr = driver.findElement(By.xpath(“//iframe[contains(@src,’accounts.zoho.com/login’)]”));
driver.switchTo().frame(ifr);
driver.findElement(By.id(“lid”)).sendKeys(“venkyin.2218@gmail.com”);
driver.findElement(By.id(“pwd”)).sendKeys(“Venkatesh”);
driver.findElement(By.id(“submit_but”)).click();
driver.switchTo().defaultContent();
WebDriverWait wait = new WebDriverWait(driver, 10);
wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(“//a[@id=’tab_Campaigns’]”)));
driver.findElement(By.xpath(“//a[@id=’tab_Campaigns’]”)).click();
driver.findElement(By.xpath(“//tr[td[3][a[text()=’Venky’]]]”)).click();
driver.findElement(By.linkText(“Add Existing Leads”)).click();
driver.findElement(By.name(“search”)).click();
driver.close();
}
}

 

Source: http://selenium-makeiteasy.blogspot.com