Exemplo n.º 1
0
 public static DriverConstruct getDriver() {
   DriverConstruct driver;
   if ((driver = webDriverLocal.get()) == null) {
     try {
       driver =
           new DriverConstruct(
               new URL(Proper.GetProperty("sServerGrid")), DesiredCapabilities.firefox());
     } catch (MalformedURLException exc) {
       exc.printStackTrace();
     }
     webDriverLocal.set(driver);
     return driver;
   } else return driver;
 }
Exemplo n.º 2
0
 public WebDriver build(WebBrowser browser) {
   if (driver.get() == null) {
     switch (browser) {
       case Chrome:
         driver.set(startChromeBrowser());
         break;
       case IE:
         driver.set(startIEBrowser());
         break;
       case Safari:
         driver.set(startSafariBrowser());
         break;
       case Firefox:
       default:
         driver.set(startFirefoxBrowser());
         break;
     }
   }
   return driver.get();
 }
Exemplo n.º 3
0
 public WebDriver get() {
   return driver.get();
 }
Exemplo n.º 4
0
 public void deleteDriver() {
   driver.remove();
 }
Exemplo n.º 5
0
 public static void stopDriver(WebDriver driver) {
   if (driver != null) {
     webDriverLocal.remove();
     driver.quit();
   }
 }