Java Code Examples for org.openqa.selenium.remote.HttpCommandExecutor#getAddressOfRemoteServer()

The following examples show how to use org.openqa.selenium.remote.HttpCommandExecutor#getAddressOfRemoteServer() . 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: WebDriverFactory.java    From Cognizant-Intelligent-Test-Scripter with Apache License 2.0 5 votes vote down vote up
/**
 * Patch for
 * https://github.com/CognizantQAHub/Cognizant-Intelligent-Test-Scripter/issues/7
 * Based on
 * https://github.com/mozilla/geckodriver/issues/759#issuecomment-308522851
 *
 * @param fDriver FirefoxDriver
 */
private static void addGeckoDriverAddon(FirefoxDriver fDriver) {
    if (SystemDefaults.getClassesFromJar.get() && SystemDefaults.debugMode.get()) {
        if (FilePath.getFireFoxAddOnPath().exists()) {
            HttpCommandExecutor ce = (HttpCommandExecutor) fDriver.getCommandExecutor();
            String url = ce.getAddressOfRemoteServer() + "/session/" + fDriver.getSessionId() + "/moz/addon/install";
            addGeckoDriverAddon(FilePath.getFireFoxAddOnPath(), url);
        }
    }
}
 
Example 2
Source File: AppiumDriver.java    From java-client with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new instance based on command {@code executor} and {@code capabilities}.
 *
 * @param executor     is an instance of {@link HttpCommandExecutor}
 *                     or class that extends it. Default commands or another vendor-specific
 *                     commands may be specified there.
 * @param capabilities take a look at {@link Capabilities}
 */
public AppiumDriver(HttpCommandExecutor executor, Capabilities capabilities) {
    super(executor, capabilities);
    this.executeMethod = new AppiumExecutionMethod(this);
    locationContext = new RemoteLocationContext(executeMethod);
    super.setErrorHandler(errorHandler);
    this.remoteAddress = executor.getAddressOfRemoteServer();
    this.setElementConverter(new JsonToMobileElementConverter(this));
}