Friday, 4 August 2017

Code Example - Browser With Given Dimension

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);
}
}

No comments:

Post a Comment

Code Example - File Download By Robot Class In Firefox Browser

Exported from Notepad++ package com . practiceCode ; import java . awt . AWTException ; import java . awt . Robot ; import j...