public bool TerminateApp(string appId, TimeSpan timeout) => Convert.ToBoolean(Execute(AppiumDriverCommand.TerminateApp, AppiumCommandExecutionHelper.PrepareArguments(new string[] { "appId", "options" }, new object[] { appId, new Dictionary <string, object>() { { "timeout", (long)timeout.TotalMilliseconds } } })).Value.ToString());
public void PerformTouchAction(ITouchAction touchAction) { if (touchAction == null) { return; } var parameters = AppiumCommandExecutionHelper.PrepareArgument("actions", touchAction.GetParameters()); Execute(AppiumDriverCommand.PerformTouchAction, parameters); }
public void BackgroundApp(TimeSpan timeSpan) => Execute(AppiumDriverCommand.BackgroundApp, AppiumCommandExecutionHelper.PrepareArgument("seconds", timeSpan.TotalSeconds));
public void BackgroundApp(int seconds) => Execute(AppiumDriverCommand.BackgroundApp, AppiumCommandExecutionHelper.PrepareArgument("seconds", seconds));
public void ToggleData() => AppiumCommandExecutionHelper.ToggleData(this);
public void FingerPrint(int fingerprintId) => AppiumCommandExecutionHelper.FingerPrint(this, fingerprintId);
/// <summary> /// Hides the device keyboard. /// </summary> /// <param name="strategy">Hide keyboard strategy (optional, UIAutomation only). Available strategies - 'press', 'pressKey', 'swipeDown', 'tapOut', 'tapOutside', 'default'.</param> /// <param name="key">The button pressed by the mobile driver to attempt hiding the keyboard.</param> public void HideKeyboard(string strategy, string key) => AppiumCommandExecutionHelper.HideKeyboard(executeMethod: this, strategy: strategy, key: key);
public byte[] PullFile(string pathOnDevice) => Convert.FromBase64String(Execute(AppiumDriverCommand.PullFile, AppiumCommandExecutionHelper.PrepareArgument("path", pathOnDevice)).Value.ToString());
public byte[] PullFolder(string remotePath) => Convert.FromBase64String(Execute(AppiumDriverCommand.PullFolder, AppiumCommandExecutionHelper.PrepareArgument("path", remotePath)).Value.ToString());
public bool TerminateApp(string appId) => Convert.ToBoolean(Execute(AppiumDriverCommand.TerminateApp, AppiumCommandExecutionHelper.PrepareArgument("appId", appId)).Value.ToString());
public bool IsAppInstalled(string bundleId) => Convert.ToBoolean(Execute(AppiumDriverCommand.IsAppInstalled, AppiumCommandExecutionHelper.PrepareArgument("bundleId", bundleId)).Value.ToString());
public void ActivateApp(string appId) => Execute(AppiumDriverCommand.ActivateApp, AppiumCommandExecutionHelper.PrepareArgument("appId", appId));
public void InstallApp(string appPath) => Execute(AppiumDriverCommand.InstallApp, AppiumCommandExecutionHelper.PrepareArgument("appPath", appPath));
public void BackgroundApp() => Execute(AppiumDriverCommand.BackgroundApp, AppiumCommandExecutionHelper.PrepareArgument("seconds", AppiumCommandExecutionHelper.PrepareArgument("timeout", null)));
public AppState GetAppState(string appId) => (AppState)Convert.ToInt32(Execute(AppiumDriverCommand.GetAppState, AppiumCommandExecutionHelper.PrepareArgument("appId", appId)).Value.ToString());
public void PushFile(string pathOnDevice, string stringData) => AppiumCommandExecutionHelper.PushFile(this, pathOnDevice, Convert.FromBase64String(Convert.ToBase64String(Encoding.UTF8.GetBytes(stringData))));
/// <summary> /// Hides the device keyboard. /// </summary> public void HideKeyboard() => AppiumCommandExecutionHelper.HideKeyboard(this, null, null);
public void PushFile(string pathOnDevice, byte[] base64Data) => AppiumCommandExecutionHelper.PushFile(this, pathOnDevice, base64Data);
/// <summary> /// Activate the given IME on Device /// </summary> /// <param name="imeEngine">IME to activate</param> public void ActivateIMEEngine(string imeEngine) => Execute(AppiumDriverCommand.ActivateEngine, AppiumCommandExecutionHelper.PrepareArgument("engine", imeEngine));
public void PushFile(string pathOnDevice, FileInfo file) => AppiumCommandExecutionHelper.PushFile(this, pathOnDevice, file);
public string StopRecordingScreen(IScreenRecordingOptions options) { var parameters = AppiumCommandExecutionHelper.PrepareArgument("options", options.GetParameters()); return(Execute(AppiumDriverCommand.StopRecordingScreen, parameters).Value.ToString()); }
/// <summary> /// Whether or not the soft keyboard is shown. /// </summary> /// <returns>True if the keyboard is shown. (boolean)</returns> public bool IsKeyboardShown() => AppiumCommandExecutionHelper.IsKeyboardShown(executeMethod: this);