示例#1
0
 public void initTestSuite() throws IOException {
   //    baseUrl = PropertyLoader.loadProperty("site.url");
   //    gridHubUrl = PropertyLoader.loadProperty("grid.url");
   //    if ("".equals(gridHubUrl)) {
   //      gridHubUrl = null;
   //    }
   capabilities = PropertyLoader.loadCapabilities();
   WebDriverFactory.setMode(WebDriverFactoryMode.THREADLOCAL_SINGLETON);
   driver = WebDriverFactory.getDriver(capabilities);
 }
  @BeforeClass
  public void init() {
    baseUrl = PropertyLoader.loadProperty("site.url");
    gridHubUrl = PropertyLoader.loadProperty("grid2.hub");

    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setBrowserName(PropertyLoader.loadProperty("browser.name"));
    capabilities.setVersion(PropertyLoader.loadProperty("browser.version"));
    String platform = PropertyLoader.loadProperty("browser.platform");
    if (!(null == platform || "".equals(platform))) {
      capabilities.setPlatform(Platform.valueOf(PropertyLoader.loadProperty("browser.platform")));
    }

    if (!(null == gridHubUrl || "".equals(gridHubUrl))) {
      driver = WebDriverFactory.getDriver(gridHubUrl, capabilities);
    } else {
      driver = WebDriverFactory.getDriver(capabilities);
    }
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
  }
 @AfterSuite(alwaysRun = true)
 public void tearDown() {
   if (driver != null) {
     WebDriverFactory.dismissDriver(driver);
   }
 }
示例#4
0
 @AfterSuite(alwaysRun = true)
 public void tearDown() {
   WebDriverFactory.dismissAll();
 }