Skip to content

Instantly share code, notes, and snippets.

@heitorpaceli
Last active November 3, 2021 01:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heitorpaceli/f4cd1620b2d7e4fa377e9f3c6819860b to your computer and use it in GitHub Desktop.
Save heitorpaceli/f4cd1620b2d7e4fa377e9f3c6819860b to your computer and use it in GitHub Desktop.
Adding network - UI Automator medium article
// ...
// Obtain an instance of UiObject2 of the text field
val ssidField = device.wait(Until.findObject(By.res("com.android.settings:id/ssid")), 2000)
// Call the setText method using Kotlin's property access syntax
val ssid = "AndroidWifi"
ssidField.text = ssid
//Click on Save button
device.findObject(By.res("android:id/button1").text("Save")).click()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment