org.openqa.selenium.PageLoadStrategy Java Examples

The following examples show how to use org.openqa.selenium.PageLoadStrategy. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BrowserTab.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public void addPageLoadStrategy() {
    pageLoadStrategy = new ChoiceBox<>();
    pageLoadStrategy.getItems().add(null);
    pageLoadStrategy.getItems().addAll(FXCollections.observableArrayList(PageLoadStrategy.values()));
    String value = BrowserConfig.instance().getValue(getBrowserName(), "browser-page-load-strategy");
    if (value != null)
        pageLoadStrategy.getSelectionModel().select(PageLoadStrategy.fromString(value));
    advancedPane.addFormField("Page load strategy:", pageLoadStrategy);
}
 
Example #2
Source File: MarionetteTest.java    From selenium with Apache License 2.0 5 votes vote down vote up
@Test
public void canSetPageLoadStrategyViaOptions() {
  localDriver = new FirefoxDriver(
      new FirefoxOptions().setPageLoadStrategy(PageLoadStrategy.NONE));

  verifyItIsMarionette(localDriver);
  assertThat(localDriver.getCapabilities().getCapability(PAGE_LOAD_STRATEGY)).isEqualTo("none");
}
 
Example #3
Source File: FirefoxOptionsTest.java    From selenium with Apache License 2.0 5 votes vote down vote up
@Test
public void canInitFirefoxOptionsWithCapabilities() {
  FirefoxOptions options = new FirefoxOptions(new ImmutableCapabilities(
      MARIONETTE, false,
      PAGE_LOAD_STRATEGY, PageLoadStrategy.EAGER,
      ACCEPT_INSECURE_CERTS, true));

  assertThat(options.isLegacy()).isTrue();
  assertThat(options.getCapability(PAGE_LOAD_STRATEGY)).isEqualTo(EAGER);
  assertThat(options.getCapability(ACCEPT_INSECURE_CERTS)).isEqualTo(true);
}
 
Example #4
Source File: FirefoxOptionsTest.java    From selenium with Apache License 2.0 5 votes vote down vote up
@Test
public void canInitFirefoxOptionsWithCapabilitiesThatContainFirefoxOptions() {
  FirefoxOptions options = new FirefoxOptions().setLegacy(true).merge(
      new ImmutableCapabilities(PAGE_LOAD_STRATEGY, PageLoadStrategy.EAGER));
  Capabilities caps = new ImmutableCapabilities(FIREFOX_OPTIONS, options);

  FirefoxOptions options2 = new FirefoxOptions(caps);

  assertThat(options2.isLegacy()).isTrue();
  assertThat(options2.getCapability(PAGE_LOAD_STRATEGY)).isEqualTo(EAGER);
}
 
Example #5
Source File: EdgeHtmlOptionsTest.java    From selenium with Apache License 2.0 5 votes vote down vote up
@Test
public void canMergeWithoutChangingOriginalObject() {
  EdgeHtmlOptions options = new EdgeHtmlOptions();
  Map<String, Object> before = options.asMap();
  EdgeHtmlOptions merged = options.merge(
      new ImmutableCapabilities(CapabilityType.PAGE_LOAD_STRATEGY, PageLoadStrategy.NONE));
  // TODO: assertThat(merged).isNotSameAs(options);
  // TODO: assertThat(options.asMap()).isEqualTo(before);
  assertThat(merged.getCapability(CapabilityType.PAGE_LOAD_STRATEGY)).isEqualTo(PageLoadStrategy.NONE);
}
 
Example #6
Source File: EdgeOptionsTest.java    From selenium with Apache License 2.0 5 votes vote down vote up
@Test
public void canMergeWithoutChangingOriginalObject() {
  EdgeOptions options = new EdgeOptions();
  Map<String, Object> before = options.asMap();
  EdgeOptions merged = options.merge(
      new ImmutableCapabilities(CapabilityType.PAGE_LOAD_STRATEGY, PageLoadStrategy.NONE));
  // TODO: assertThat(merged).isNotSameAs(options);
  // TODO: assertThat(options.asMap()).isEqualTo(before);
  assertThat(merged.getCapability(CapabilityType.PAGE_LOAD_STRATEGY)).isEqualTo(PageLoadStrategy.NONE);
}
 
Example #7
Source File: DriverSettings.java    From aquality-selenium-java with Apache License 2.0 4 votes vote down vote up
@Override
public PageLoadStrategy getPageLoadStrategy() {
    String value = (String) getSettingsFile().getValueOrDefault(getDriverSettingsPath("pageLoadStrategy"), "normal");
    return PageLoadStrategy.fromString(value.toLowerCase());
}
 
Example #8
Source File: AbstractDriverOptions.java    From selenium with Apache License 2.0 4 votes vote down vote up
public DO setPageLoadStrategy(PageLoadStrategy strategy) {
  setCapability(
      PAGE_LOAD_STRATEGY,
      Require.nonNull("Page load strategy", strategy));
  return (DO) this;
}
 
Example #9
Source File: IDriverSettings.java    From aquality-selenium-java with Apache License 2.0 2 votes vote down vote up
/**
 * Gets WebDriver page load strategy.
 * @return initialized {@link PageLoadStrategy}
 */
PageLoadStrategy getPageLoadStrategy();