Package org.openqa.selenium.logging

Examples of org.openqa.selenium.logging.LoggingPreferences


  public String getSimulatorScale() {
    return (String) getCapability(SIMULATOR_SCALE);
  }

  public LoggingPreferences getLoggingPreferences() throws JSONException {
    LoggingPreferences ret = new LoggingPreferences();
    JSONObject json = (JSONObject) getCapability(CapabilityType.LOGGING_PREFS);
    if (json != null) {
      for (Object key : ImmutableList.copyOf(json.keys())) {
        String logType = (String) key;
        Level level = Level.parse((String) json.get(logType));
        ret.enable(logType, level);
      }
    }
    return ret;
  }
View Full Code Here


  }

  protected void createDriver(Level performanceLogLevel) throws Exception {
    IOSCapabilities caps = IOSCapabilities.iphone("Safari");
    if (performanceLogLevel != null) {
      LoggingPreferences logPrefs = new LoggingPreferences();
      logPrefs.enable(LogType.PERFORMANCE, performanceLogLevel);
      caps.setCapability(CapabilityType.LOGGING_PREFS, logPrefs);
    }
    super.startDriver(caps);
  }
View Full Code Here

  @Test
  public void testTurningOffLogShouldMeanNoLogMessages() throws Exception {
    Set<String> logTypes = driver.manage().logs().getAvailableLogTypes();
    for (String logType : logTypes) {
      IOSCapabilities caps = IOSCapabilities.iphone("Safari");
      LoggingPreferences logPrefs = new LoggingPreferences();
      logPrefs.enable(logType, Level.OFF);
      caps.setCapability(CapabilityType.LOGGING_PREFS, logPrefs);
      startDriver(caps);
      driver.get(pages.simpleTestPage);
      LogEntries entries = driver.manage().logs().get(logType);
      assertTrue(entries.getAll().isEmpty(),
View Full Code Here

TOP

Related Classes of org.openqa.selenium.logging.LoggingPreferences

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.