Advertisement
SeleniumETrainR

Lets Open First InternetExplorer browser using InternetExp

Dec 11th, 2012
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.18 KB | None | 0 0
  1.  import org.openqa.selenium.WebDriver;
  2. import org.openqa.selenium.ie.InternetExplorerDriver;
  3. import org.openqa.selenium.remote.DesiredCapabilities;
  4.  
  5.  
  6. public class IEtestforDesiredCapabilities {
  7.  
  8.     public static void main(String[] args) {
  9.        
  10.         // Method and Description - static DesiredCapabilities  internetExplorer()
  11.         DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
  12.        
  13.         //Method and Description - void setCapability(java.lang.String capabilityName, boolean value)
  14.         capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
  15.        
  16.         //Among the facilities provided by the System class are standard input, standard output, and error output streams; access to externally defined "properties"; a means of loading files and libraries; and a utility method for quickly copying a portion of an array.
  17.         System.setProperty("webdriver.ie.driver", "C:\\IEDriverServer.exe");
  18.        
  19.         //InternetExplorerDriver(Capabilities capabilities)
  20.         WebDriver driver = new InternetExplorerDriver(capabilities);
  21.        
  22.        
  23.         driver.manage().window().maximize();
  24.         driver.get("http://google.com");
  25.        
  26.      
  27.        
  28.         driver.quit();
  29.  
  30.  
  31.     }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement