package com.seleniumWebdriver;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.testng.annotations.Test;
/**
* @Blog Name : Selenium Code Example
* @author Deepak Gupta
* @Created Date 7-08-2017
*
*/
public class HandlingFrames extends SuperTestNG {
@Test
public void handleFrames() {
try {
driver.get("https://jqueryui.com/tabs/");
WebElement ele = driver.findElement(By.className("demo-frame"));
driver.switchTo().frame(ele);
driver.findElement(By.id("ui-id-3")).click();
logger.info("Tab is clicked");
// Back to default Content
driver.switchTo().defaultContent();
driver.findElement(By.linkText("Demos")).click();
logger.info("Demos link is clicked");
Thread.sleep(5000);
} catch (Exception e) {
e.printStackTrace();
}
}
}
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.testng.annotations.Test;
/**
* @Blog Name : Selenium Code Example
* @author Deepak Gupta
* @Created Date 7-08-2017
*
*/
public class HandlingFrames extends SuperTestNG {
@Test
public void handleFrames() {
try {
driver.get("https://jqueryui.com/tabs/");
WebElement ele = driver.findElement(By.className("demo-frame"));
driver.switchTo().frame(ele);
driver.findElement(By.id("ui-id-3")).click();
logger.info("Tab is clicked");
// Back to default Content
driver.switchTo().defaultContent();
driver.findElement(By.linkText("Demos")).click();
logger.info("Demos link is clicked");
Thread.sleep(5000);
} catch (Exception e) {
e.printStackTrace();
}
}
}
No comments:
Post a Comment