Last active
November 3, 2021 01:09
-
-
Save heitorpaceli/f4cd1620b2d7e4fa377e9f3c6819860b to your computer and use it in GitHub Desktop.
Adding network - UI Automator medium article
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
// 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