Skip to content

Instantly share code, notes, and snippets.

@heitorpaceli
Last active November 3, 2021 01:08
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/c4bd4c8cc6bfa6119a7e8084cb45726b to your computer and use it in GitHub Desktop.
Save heitorpaceli/c4bd4c8cc6bfa6119a7e8084cb45726b to your computer and use it in GitHub Desktop.
Add wifi network - UI Automator medium article
// ...
// Wait up to 2 seconds for the element be displayed on screen
val networkAndInternet = device.wait(Until.findObject(By.text("Network & internet")), 2000)
networkAndInternet.click()
// Click on element with text "Wi‑Fi"
val wifi = device.wait(Until.findObject(By.text("Wi‑Fi")), 2000)
wifi.click()
// Click on element with text "Add network"
val addNetwork = device.wait(Until.findObject(By.text("Add network")), 2000)
addNetwork.click()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment