Selecting radio push clit of android software app inward appium automation exam is same activity every bit selecting check-box every bit described inward my Earlier article. Only deviation betwixt check-box pick in addition to radio push clit pick is you lot tin hand the axe pick out solely i radio push clit at a fourth dimension from given listing of radio buttons but you lot tin hand the axe pick out all check-box from given list. So it is slow to pick out radio push clit of whatsoever android software app using appium automation test. Let's accept unproblematic illustration to empathise how to pick out radio push clit of android app In appium software automation test.
App To Use And Aim To Achieve In Appium Test
We volition role API Demos app In this appium software automation exam to larn how to pick out radio push clit of android app every bit shown inward bellow given screenshot.
Manually you lot tin hand the axe acquire to higher upward covert from API Demos app's Home -> Views -> Controls -> 2. Dark Theme.
Create And Run Test
Create in addition to bellow given radio push clit pick appium exam inward eclipse.
SelectingRadioButton.java
package Android; import io.appium.java_client.android.AndroidDriver; import java.net.URL; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.remote.DesiredCapabilities; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; world class SelectingRadioButton { AndroidDriver driver; @BeforeTest world void setUp() throws Exception { DesiredCapabilities capabilities = novel DesiredCapabilities(); capabilities.setCapability("deviceName", "ZX1B32FFXF"); capabilities.setCapability("browserName", "Android"); capabilities.setCapability("platformVersion", "4.4.2"); capabilities.setCapability("platformName", "Android"); capabilities.setCapability("appPackage", "io.appium.android.apis"); capabilities.setCapability("appActivity","io.appium.android.apis.ApiDemos"); driver = novel AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS); } @Test world void select() throws InterruptedException { // Scroll till chemical part which contains "Views" text If It Is non visible on screen. driver.scrollTo("Views"); // Click on Views. driver.findElement(By.name("Views")).click(); // Scroll till chemical part which contains "Controls" text If It Is non visible on screen. driver.scrollTo("Controls"); // Click on Controls. driver.findElement(By.name("Controls")).click(); // Scroll till chemical part which contains "2. Dark Theme" text If It Is non visible on screen. driver.scrollTo("2. Dark Theme"); // Click on 2. Dark Theme. driver.findElement(By.name("2. Dark Theme")).click(); // Click on RadioButton ii to pick out it. driver.findElement(By.name("RadioButton 2")).click(); } @AfterTest world void End() { driver.quit(); } }
Run higher upward exam inward eclipse using testng in addition to appium in addition to uncovering execution inward android mobile screen. Last syntax in @Test method volition pick out radio button.
This means you lot tin hand the axe pick out radio push clit of whatsoever android app using appium software automation test.