org.openqa.selenium.remote.RemoteWebDriver.manage()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(274)

本文整理了Java中org.openqa.selenium.remote.RemoteWebDriver.manage方法的一些代码示例,展示了RemoteWebDriver.manage的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RemoteWebDriver.manage方法的具体详情如下:
包路径:org.openqa.selenium.remote.RemoteWebDriver
类名称:RemoteWebDriver
方法名:manage

RemoteWebDriver.manage介绍

暂无

代码示例

代码示例来源:origin: testcontainers/testcontainers-java

@NotNull
private static RemoteWebDriver setupDriverFromRule(BrowserWebDriverContainer rule) {
  RemoteWebDriver driver = rule.getWebDriver();
  driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
  return driver;
}

代码示例来源:origin: la-team/light-admin

@Override
  public Options manage() {
    return webDriver.manage();
  }
}

代码示例来源:origin: la-team/light-admin

public RemoteWebDriver webDriver() {
  final RemoteWebDriver driver = webDriver(environment.getProperty("selenium.browser"));
  driver.manage().timeouts().implicitlyWait(webDriverWaitTimeout(), TimeUnit.SECONDS);
  driver.manage().window().maximize();
  return driver;
}

代码示例来源:origin: org.xwiki.platform/xwiki-platform-test-ui

@Override
public Options manage()
{
  return this.wrappedDriver.manage();
}

代码示例来源:origin: org.eclipse.che.selenium/che-selenium-core

@Override
public Options manage() {
 return driver.manage();
}

代码示例来源:origin: org.mycore/selenium-utils

public Options manage() {
  return delegate.manage();
}

代码示例来源:origin: com.applitools/eyes-selenium-java3

public Options manage() {
  return driver.manage();
}

代码示例来源:origin: com.github.becausetesting/commons

/**
 * @Title: clearBrowserData @Description: TODO @author
 *         ahu@greendotcorp.com @param @return void return type @throws
 */
public void clearBrowserCookies() {
  driver.manage().deleteAllCookies();
  // driver.quit();
}

代码示例来源:origin: com.github.becausetesting/commons

/**
 * @Title: getOutputlog @Description: TODO @author
 *         ahu@greendotcorp.com @param @return void return type @throws
 */
public void getOutputlog() {
  LogEntries logEntries = driver.manage().logs().get(LogType.BROWSER);
  for (LogEntry entry : logEntries) {
    log.info(Calendar.getInstance().getTime() + " " + entry.getLevel() + " " + entry.getMessage());
    // do something useful with the data
  }
}

代码示例来源:origin: com.saucelabs/sebuilder-interpreter

@Override
  public boolean run(TestRun ctx) {
    Cookie c = ctx.driver().manage().getCookieNamed(ctx.string("name"));
    if (c != null) {
      ctx.driver().manage().deleteCookie(c);
    }
    return true;
  }
}

代码示例来源:origin: com.synaptix.redpepper/redpepper-automation

public RemoteWebDriver getRemoteDriver(boolean canTakeScreenShots) throws MalformedURLException {
  RemoteWebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), DesiredCapabilities.firefox());
  driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
  // if(canTakeScreenShots){
  // WebDriver augmentedDriver = new Augmenter().augment(driver);
  // File screenshot = ((TakesScreenshot) augmentedDriver).getScreenshotAs(OutputType.FILE);
  // }
  return driver;
}

代码示例来源:origin: com.saucelabs/sebuilder-interpreter

@Override
public String get(TestRun ctx) {
  return "" + (ctx.driver().manage().getCookieNamed(ctx.string("name")) != null);
}

代码示例来源:origin: iainrose/page-objects

@AfterMethod(alwaysRun = true)
public void deleteAllCookies() {
  driver.manage().deleteAllCookies();
}

代码示例来源:origin: com.saucelabs/sebuilder-interpreter

@Override
public String get(TestRun ctx) {
  return ctx.driver().manage().getCookieNamed(ctx.string("name")).getValue();
}

代码示例来源:origin: te-con/ehour

public static void logout() {
  Driver.get(BASE_URL + "/eh/logout");
  Driver.manage().deleteAllCookies();
}

代码示例来源:origin: te-con/ehour

public static boolean isBookingHoursPossible(int day) {
  try {
    AbstractScenario.Driver.manage().timeouts().implicitlyWait(1, TimeUnit.SECONDS);
    String wicketPath = "contentContainer_timesheetFrame_timesheetFrame__body_timesheetForm_blueFrame_blueFrame__body_customers_0_rows_0_days_" + day + "_day_day";
    Driver.findElement(WicketBy.wicketPath(wicketPath));
    return true;
  } catch (org.openqa.selenium.NoSuchElementException nse) {
    return false;
  }
  finally {
    AbstractScenario.Driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
  }
}

代码示例来源:origin: te-con/ehour

public static void login(ItUser user) {
  Driver.manage().deleteAllCookies();
  Driver.get(BASE_URL + "/eh/login");
  findElement(WicketBy.wicketPath("loginform_username")).clear();
  findElement(WicketBy.wicketPath("loginform_username")).sendKeys(user.name);
  findElement(WicketBy.wicketPath("loginform_password")).sendKeys(user.password);
  findElement(By.id("loginSubmit")).click();
  assertTrue(findElement(By.cssSelector("BODY")).getText().matches("^[\\s\\S]*Signed in as[\\s\\S]*$"));
}

代码示例来源:origin: com.applitools/eyes-selenium-java3

public Object executeAsyncScript(String script, Object... args) {
  // Appium commands are sometimes sent as Javascript
  if (AppiumJsCommandExtractor.isAppiumJsCommand(script)) {
    Trigger trigger =
        AppiumJsCommandExtractor.extractTrigger(elementsIds,
            driver.manage().window().getSize(), script, args);
    if (trigger != null) {
      // TODO - Daniel, additional type of triggers
      if (trigger instanceof MouseTrigger) {
        MouseTrigger mt = (MouseTrigger) trigger;
        eyes.addMouseTrigger(mt.getMouseAction(),
            mt.getControl(), mt.getLocation());
      }
    }
  }
  return driver.executeAsyncScript(script, args);
}

代码示例来源:origin: com.applitools/eyes-selenium-java3

public Object executeScript(String script, Object... args) {
  // Appium commands are sometimes sent as Javascript
  if (AppiumJsCommandExtractor.isAppiumJsCommand(script)) {
    Trigger trigger =
        AppiumJsCommandExtractor.extractTrigger(elementsIds,
            driver.manage().window().getSize(), script, args);
    if (trigger != null) {
      // TODO - Daniel, additional types of triggers
      if (trigger instanceof MouseTrigger) {
        MouseTrigger mt = (MouseTrigger) trigger;
        eyes.addMouseTrigger(mt.getMouseAction(), mt.getControl(), mt.getLocation());
      }
    }
  }
  @SuppressWarnings("UnnecessaryLocalVariable")
  Object result = driver.executeScript(script, args);
  return result;
}

代码示例来源:origin: iainrose/page-objects

@BeforeClass(alwaysRun = true)
public void setupWebDriver() throws MalformedURLException {
  if (REMOTE_DRIVER) {
    setupRemoteDriver();
    driver.setFileDetector(new LocalFileDetector());
  } else {
    setupLocalDriver();
  }
  driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}

相关文章