All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.appium.java_client.AppiumExecutionMethod Maven / Gradle / Ivy

There is a newer version: 9.3.0
Show newest version
package io.appium.java_client;

import com.google.common.collect.ImmutableMap;
import org.openqa.selenium.remote.ExecuteMethod;
import org.openqa.selenium.remote.Response;

import java.util.Map;

public class AppiumExecutionMethod implements ExecuteMethod {
  private final AppiumDriver driver;

  public AppiumExecutionMethod(AppiumDriver driver) {
    this.driver = driver;
  }

  public Object execute(String commandName, Map parameters) {
    Response response;

    if (parameters == null || parameters.isEmpty()) {
      response = driver.execute(commandName, ImmutableMap.of());
    } else {
      response = driver.execute(commandName, parameters);
    }

    return response.getValue();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy