How to handle frame window in selenium?

package webElementMethods;


import java.util.concurrent.TimeUnit;


import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.WebElement;

import org.openqa.selenium.chrome.ChromeDriver;


public class HandleFrameGetAttributes {


public static void main(String[] args) {

System.setProperty("webdriver.chrome.driver",

"D:\\Software\\Testing-Tools\\Selenium\\WebDriver\\Drivers\\IEChromeFirefox\\19092018\\chromedriver.exe");

WebDriver driver = new ChromeDriver();

driver.manage().window().maximize();

driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

driver.get("https://jqueryui.com/draggable/");


WebElement frameBox = driver.findElement(By.xpath("//*[@id=\"content\"]/iframe"));

driver.switchTo().frame(frameBox);

System.out.println(driver.findElement(By.id("draggable")).getAttribute("style"));

driver.switchTo().defaultContent();

}


}


Comments

Popular posts from this blog

For Get Dynamic data & USe it into Postman Body parameters

What is data driven testing?

API Automation Testing Script to check Response

How to work with mouse hover menu in selenium?

How does Selenium Webdriver handle SSL certificate in Chrome?