Module appium_client::commands
source · Expand description
Commands that you can issue to Appium server
The commands in submodules are a facade to low-level issue_cmd
([fantoccini::Client::issue_cmd]).
So in most cases, you need a specific function from one of those modules (e.g. keyboard::HidesKeyboard::hide_keyboard).
Available commands
Please check all submodules if you want to learn what features are implemented in this lib. See traits in below modules to learn what you can do with the client.
Alternatively, you can check out crate::IOSClient and crate::AndroidClient to see all traits of those clients in the docs.
How to use commands
AppiumCommand is a struct used by low-level issue_cmd
([fantoccini::Client::issue_cmd]).
So unless you’re implementing missing features yourself, you don’t need to wory about it.
This lib exposes both APIs to be more flexible. So a rule of thumb is:
- use a command from submodule if it’s available (in other words - use by default),
- use AppiumCommand::Custom in other cases
let mut capabilities = AndroidCapabilities::new_uiautomator();
let client = ClientBuilder::native(capabilities)
.connect("http://localhost:4723/wd/hub/")
.await?;
// this feature is implemented in keyboard submodule (recommended)
client.hide_keyboard().await?;
// this is a low-level implementation of the same command (not recommended, unless you have a specific use case for this)
client.issue_cmd(AppiumCommand::Custom(
Method::POST,
"appium/device/hide_keyboard".to_string(),
Some(json!({})),
)).await?;
Modules
- Android-specific features
- Management of apps on the device
- Device authentication
- Battery info
- Clipboard management
- Context API (https://appium.io/docs/en/2.1/guides/context/)
- Files management
- iOS-specific features
- Keyboard management
- Geolocation
- Lock and unlock the device
- Network management
- Screen recording
- Device orientation and rotation
- Settings API (https://appium.io/docs/en/2.1/guides/settings/)
- App strings (localized text from app)
- Device time
Enums
- Basic Appium commands