The "To" Buttom is unable to take keys from selenium webdriver. In output it shows Unable to locate element. "To" is in iframe and I have used I frame but then also it not working.
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class mail {
public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.gecko.driver", "D:\mozilla driver\geckodriver.exe");
WebDriver driver=new FirefoxDriver();
driver.get("https://www.mail.com/int/");
driver.findElement(By.xpath(".//*[@id='login-button']")).click();
driver.findElement(By.xpath(".//*[@id='login-email']")).sendKeys("rahulrahulxyz@mail.com");
driver.findElement(By.xpath(".//*[@id='login-password']")).sendKeys("incredible");
driver.findElement(By.xpath(".//*[@id='login-form']/button")).click();
driver.switchTo().frame("thirdPartyFrame_home");
driver.findElement(By.linkText("Compose E-mail")).click();
Thread.sleep(5000);
driver.switchTo().frame("thirdPartyFrame_mail"); // **here is error**
driver.findElement(By.xpath(".//*[@id='idbd']/div[2]/div[1]/div[1]/div[2]/div/div/ul/li/input")).sendKeys("abcde@mail.com");
}
}