package com.seleniumWebdriver;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Test;
/**
* @Blog Name : Selenium Code Example
* @author Deepak Gupta
* @Created Date 4-08-2017
*
*/
public class BrowserWithGivenDimension {
@Test
public void openBrowserwithGivenDimension() {
WebDriver driver = new FirefoxDriver();
driver.navigate().to("http://google.co.in");
System.out.println(driver.manage().window().getSize());
Dimension d = new Dimension(420, 600);
// Resize the current window to the given dimension
driver.manage().window().setSize(d);
}
}
import org.openqa.selenium.Dimension;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Test;
/**
* @Blog Name : Selenium Code Example
* @author Deepak Gupta
* @Created Date 4-08-2017
*
*/
public class BrowserWithGivenDimension {
@Test
public void openBrowserwithGivenDimension() {
WebDriver driver = new FirefoxDriver();
driver.navigate().to("http://google.co.in");
System.out.println(driver.manage().window().getSize());
Dimension d = new Dimension(420, 600);
// Resize the current window to the given dimension
driver.manage().window().setSize(d);
}
}
No comments:
Post a Comment