Getting error in program to practice frame in your page. Not able to click the element their or sometimes switch to frame 2

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

 

public class test {

public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub
System.setProperty(“webdriver.chrome.driver”, “D:\\ak00325892\\TECHM\\Selenium\\ChromeDriver\\chromedriver.exe”);
WebDriver driver= new ChromeDriver();
driver.manage().deleteAllCookies();
//driver.manage().window().maximize();
driver.get(“http://toolsqa.com/iframe-practice-page/”);
Thread.sleep(5000);
driver.switchTo().frame(“iframe1”);
driver.findElement(By.xpath(“//input[@name=’firstname’]”)).sendKeys(“Aman”);
Thread.sleep(5000);
driver.switchTo().frame(“IF2”);
//driver.switchTo().frame(“iframe2”);
driver.findElement(By.xpath(“//a[text()=’Tab 2 ‘]”)).click();

}

}

Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.