package TechLearndotin;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.AfterTest;
public class TechLearn {
public WebDriver driver;
@Test
public void BrowserwithGivenDimension() throws Exception
{
driver.get("http://techlearn.in");
driver.manage().window().maximize();//The standard layout is for desktops, laptops and other large screen devices.
System.out.println(driver.manage().window().getSize());
Thread.sleep(5000);
driver.get("http://techlearn.in");
Dimension n = new Dimension(580,768); //Tablet devices such as iPad, Android and Windows tablets have two orientations
driver.manage().window().setSize(n);
System.out.println(driver.manage().window().getSize());
Thread.sleep(5000);
driver.get("http://techlearn.in");
Dimension k = new Dimension(320,580); //Smalltouch devices such as iPhone, Android and Windows phones
driver.manage().window().setSize(k);
System.out.println(driver.manage().window().getSize());
}
@BeforeTest
public void beforeTest() {
driver= new FirefoxDriver();
}
@AfterTest
public void afterTest() {
}
}