Example usage for org.openqa.selenium.remote HttpCommandExecutor HttpCommandExecutor

List of usage examples for org.openqa.selenium.remote HttpCommandExecutor HttpCommandExecutor

Introduction

In this page you can find the example usage for org.openqa.selenium.remote HttpCommandExecutor HttpCommandExecutor.

Prototype

public HttpCommandExecutor(Map<String, CommandInfo> additionalCommands, URL addressOfRemoteServer) 

Source Link

Document

Creates an HttpCommandExecutor that supports non-standard additionalCommands in addition to the standard.

Usage

From source file:io.appium.java_client.AppiumDriver.java

License:Apache License

public AppiumDriver(URL remoteAddress, Capabilities desiredCapabilities) {

    super(remoteAddress, desiredCapabilities);

    this.executeMethod = new AppiumExecutionMethod(this);
    this.remoteAddress = remoteAddress;
    locationContext = new RemoteLocationContext(executeMethod);

    ImmutableMap.Builder<String, CommandInfo> builder = ImmutableMap.builder();
    builder.put(RESET, postC("/session/:sessionId/appium/app/reset"))
            .put(GET_STRINGS, postC("/session/:sessionId/appium/app/strings"))
            .put(KEY_EVENT, postC("/session/:sessionId/appium/device/keyevent"))
            .put(CURRENT_ACTIVITY, getC("/session/:sessionId/appium/device/current_activity"))
            .put(SET_VALUE, postC("/session/:sessionId/appium/element/:id/value"))
            .put(PULL_FILE, postC("/session/:sessionId/appium/device/pull_file"))
            .put(PULL_FOLDER, postC("/session/:sessionId/appium/device/pull_folder"))
            .put(HIDE_KEYBOARD, postC("/session/:sessionId/appium/device/hide_keyboard"))
            .put(PUSH_FILE, postC("/session/:sessionId/appium/device/push_file"))
            .put(RUN_APP_IN_BACKGROUND, postC("/session/:sessionId/appium/app/background"))
            .put(PERFORM_TOUCH_ACTION, postC("/session/:sessionId/touch/perform"))
            .put(PERFORM_MULTI_TOUCH, postC("/session/:sessionId/touch/multi/perform"))
            .put(IS_APP_INSTALLED, postC("/session/:sessionId/appium/device/app_installed"))
            .put(INSTALL_APP, postC("/session/:sessionId/appium/device/install_app"))
            .put(REMOVE_APP, postC("/session/:sessionId/appium/device/remove_app"))
            .put(LAUNCH_APP, postC("/session/:sessionId/appium/app/launch"))
            .put(CLOSE_APP, postC("/session/:sessionId/appium/app/close"))
            .put(END_TEST_COVERAGE, postC("/session/:sessionId/appium/app/end_test_coverage"))
            .put(LOCK, postC("/session/:sessionId/appium/device/lock"))
            .put(IS_LOCKED, postC("/session/:sessionId/appium/device/is_locked"))
            .put(SHAKE, postC("/session/:sessionId/appium/device/shake"))
            .put(COMPLEX_FIND, postC("/session/:sessionId/appium/app/complex_find"))
            .put(OPEN_NOTIFICATIONS, postC("/session/:sessionId/appium/device/open_notifications"))
            .put(GET_NETWORK_CONNECTION, getC("/session/:sessionId/network_connection"))
            .put(SET_NETWORK_CONNECTION, postC("/session/:sessionId/network_connection"))
            .put(GET_SETTINGS, getC("/session/:sessionId/appium/settings"))
            .put(SET_SETTINGS, postC("/session/:sessionId/appium/settings"))
            .put(START_ACTIVITY, postC("/session/:sessionId/appium/device/start_activity"))
            .put(TOGGLE_LOCATION_SERVICES, postC("/session/:sessionId/appium/device/toggle_location_services"));

    ImmutableMap<String, CommandInfo> mobileCommands = builder.build();

    HttpCommandExecutor mobileExecutor = new HttpCommandExecutor(mobileCommands, remoteAddress);
    super.setCommandExecutor(mobileExecutor);

    super.setErrorHandler(errorHandler);
}