/** * @param executor is an instance of {@link org.openqa.selenium.remote.HttpCommandExecutor} * or class that extends it. Default commands or another vendor-specific * commands may be specified there. * @param capabilities take a look * at {@link org.openqa.selenium.Capabilities} * @param converterClazz is an instance of a class that extends * {@link org.openqa.selenium.remote.internal.JsonToWebElementConverter}. It converts * JSON response to an instance of * {@link org.openqa.selenium.WebElement} */ protected AppiumDriver(HttpCommandExecutor executor, Capabilities capabilities, Class<? extends JsonToWebElementConverter> converterClazz) { super(executor, capabilities); this.executeMethod = new AppiumExecutionMethod(this); locationContext = new RemoteLocationContext(executeMethod); super.setErrorHandler(errorHandler); this.remoteAddress = executor.getAddressOfRemoteServer(); try { Constructor<? extends JsonToWebElementConverter> constructor = converterClazz.getConstructor(RemoteWebDriver.class); this.setElementConverter(constructor.newInstance(this)); } catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) { throw new RuntimeException(e); } }
public AppiumDriver(URL remoteAddress, Capabilities desiredCapabilities, Class<? extends JsonToWebElementConverter> converterClazz) { this(new AppiumCommandExecutor(MobileCommand.commandRepository, remoteAddress), desiredCapabilities, converterClazz); }
public AppiumDriver(URL remoteAddress, HttpClient.Factory httpClientFactory, Capabilities desiredCapabilities, Class<? extends JsonToWebElementConverter> converterClazz) { this(new AppiumCommandExecutor(MobileCommand.commandRepository, remoteAddress, httpClientFactory), desiredCapabilities, converterClazz); }
public AppiumDriver(AppiumDriverLocalService service, Capabilities desiredCapabilities, Class<? extends JsonToWebElementConverter> converterClazz) { this(new AppiumCommandExecutor(MobileCommand.commandRepository, service), desiredCapabilities, converterClazz); }
public AppiumDriver(AppiumDriverLocalService service, HttpClient.Factory httpClientFactory, Capabilities desiredCapabilities, Class<? extends JsonToWebElementConverter> converterClazz) { this(new AppiumCommandExecutor(MobileCommand.commandRepository, service, httpClientFactory), desiredCapabilities, converterClazz); }
public AppiumDriver(AppiumServiceBuilder builder, Capabilities desiredCapabilities, Class<? extends JsonToWebElementConverter> converterClazz) { this(builder.build(), desiredCapabilities, converterClazz); }
public AppiumDriver(AppiumServiceBuilder builder, HttpClient.Factory httpClientFactory, Capabilities desiredCapabilities, Class<? extends JsonToWebElementConverter> converterClazz) { this(builder.build(), httpClientFactory, desiredCapabilities, converterClazz); }
public AppiumDriver(HttpClient.Factory httpClientFactory, Capabilities desiredCapabilities, Class<? extends JsonToWebElementConverter> converterClazz) { this(AppiumDriverLocalService.buildDefaultService(), httpClientFactory, desiredCapabilities, converterClazz); }
public AppiumDriver(Capabilities desiredCapabilities, Class<? extends JsonToWebElementConverter> converterClazz) { this(AppiumDriverLocalService.buildDefaultService(), desiredCapabilities, converterClazz); }
protected void setElementConverter(RemoteWebDriver d) { JsonToWebElementConverter converter = createElementConverter(d); Environment.getInstance().getReflectionHelper().setField(d, "converter", converter); }
protected JsonToWebElementConverter createElementConverter(RemoteWebDriver d) { return new WebElementConverter(d); }