org.openqa.selenium.remote.ExecuteMethod Java Examples

The following examples show how to use org.openqa.selenium.remote.ExecuteMethod. 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: PerformanceLoggingMockTest.java    From selenium with Apache License 2.0 6 votes vote down vote up
@Test
public void testMergesRemoteLogs() {
  final ExecuteMethod executeMethod = mock(ExecuteMethod.class);

  when(executeMethod.execute(
      DriverCommand.GET_LOG, ImmutableMap.of(RemoteLogs.TYPE_KEY, LogType.PROFILER)))
      .thenReturn(Arrays.asList(ImmutableMap.of(
        "level", Level.INFO.getName(),
        "timestamp", 1L,
        "message", "second")));

  LocalLogs localLogs = LocalLogs.getStoringLoggerInstance(singleton(LogType.PROFILER));
  RemoteLogs logs = new RemoteLogs(executeMethod, localLogs);
  localLogs.addEntry(LogType.PROFILER, new LogEntry(Level.INFO, 0, "first"));
  localLogs.addEntry(LogType.PROFILER, new LogEntry(Level.INFO, 2, "third"));

  List<LogEntry> entries = logs.get(LogType.PROFILER).getAll();
  assertThat(entries).hasSize(3);
  for (int i = 0; i < entries.size(); ++i) {
    assertThat(entries.get(i).getTimestamp()).isEqualTo(i);
  }
}
 
Example #2
Source File: AppiumDriver.java    From java-client with Apache License 2.0 4 votes vote down vote up
@Override
public ExecuteMethod getExecuteMethod() {
    return executeMethod;
}
 
Example #3
Source File: DevToolsProvider.java    From selenium with Apache License 2.0 4 votes vote down vote up
@Override
public HasDevTools getImplementation(Capabilities caps, ExecuteMethod executeMethod) {
  Optional<DevTools> devTools = SeleniumCdpConnection.create(caps).map(DevTools::new);

  return () -> devTools.orElseThrow(() -> new IllegalStateException("Unable to create connection to " + caps));
}
 
Example #4
Source File: AddLocationContext.java    From selenium with Apache License 2.0 4 votes vote down vote up
@Override
public LocationContext getImplementation(Capabilities capabilities, ExecuteMethod executeMethod) {
  return new RemoteLocationContext(executeMethod);
}
 
Example #5
Source File: RemoteLocationContext.java    From selenium with Apache License 2.0 4 votes vote down vote up
public RemoteLocationContext(ExecuteMethod executeMethod) {
  this.executeMethod = executeMethod;
}
 
Example #6
Source File: AddApplicationCache.java    From selenium with Apache License 2.0 4 votes vote down vote up
@Override
public ApplicationCache getImplementation(Capabilities capabilities, ExecuteMethod executeMethod) {
  return new RemoteApplicationCache(executeMethod);
}
 
Example #7
Source File: RemoteLocalStorage.java    From selenium with Apache License 2.0 4 votes vote down vote up
public RemoteLocalStorage(ExecuteMethod executeMethod) {
  this.executeMethod = executeMethod;
}
 
Example #8
Source File: AddWebStorage.java    From selenium with Apache License 2.0 4 votes vote down vote up
@Override
public WebStorage getImplementation(Capabilities capabilities, ExecuteMethod executeMethod) {
  return new RemoteWebStorage(executeMethod);
}
 
Example #9
Source File: RemoteApplicationCache.java    From selenium with Apache License 2.0 4 votes vote down vote up
public RemoteApplicationCache(ExecuteMethod executeMethod) {
  this.executeMethod = executeMethod;
}
 
Example #10
Source File: RemoteWebStorage.java    From selenium with Apache License 2.0 4 votes vote down vote up
public RemoteWebStorage(ExecuteMethod executeMethod) {
  this.executeMethod = executeMethod;
}
 
Example #11
Source File: RemoteSessionStorage.java    From selenium with Apache License 2.0 4 votes vote down vote up
public RemoteSessionStorage(ExecuteMethod executeMethod) {
  this.executeMethod = executeMethod;
}
 
Example #12
Source File: RemoteNetworkConnection.java    From selenium with Apache License 2.0 4 votes vote down vote up
public RemoteNetworkConnection(ExecuteMethod executeMethod) {
  this.executeMethod = executeMethod;
}
 
Example #13
Source File: AddNetworkConnection.java    From selenium with Apache License 2.0 4 votes vote down vote up
@Override
public NetworkConnection getImplementation(Capabilities capabilities, ExecuteMethod executeMethod) {
  return new RemoteNetworkConnection(executeMethod);
}