Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Marcelo Aleks
Added: Mar 31, 2019 1:00 PM
Modified: Mar 31, 2019 1:01 PM
Views: 13
Tags: selenium
  1. import org.openqa.selenium.WebDriver;
  2. import org.openqa.selenium.firefox.FirefoxDriver;
  3. import org.openqa.selenium.Dimension;
  4.  
  5. public class BrowserOperations {
  6.     WebDriver driver;
  7.  
  8.     //this will open browser with default size
  9.     public void launchBrowser() {
  10.         driver = new FirefoxDriver();
  11.     }
  12.  
  13.     public void resizeBrowser() {
  14.         Dimension d = new Dimension(800,480);
  15. //Resize current window to the set dimension
  16.         driver.manage().window().setSize(d);
  17.     }
  18. }