Selecting radio push clit of android software app inwards appium automation exam is same activeness equally selecting check-box equally described inwards my Earlier article. Only divergence betwixt check-box alternative in addition to radio push clit alternative is you lot tin flaming direct solely i radio push clit at a fourth dimension from given listing of radio buttons but you lot tin flaming direct all check-box from given list. So it is slow to direct radio push clit of whatever android software app using appium automation test. Let's induce got uncomplicated event to sympathize how to direct 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 direct radio push clit of android app equally shown inwards bellow given screenshot.
Manually you lot tin flaming 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 alternative appium exam inwards 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 course of written report 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 ingredient 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 ingredient 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 ingredient 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 two to direct it. driver.findElement(By.name("RadioButton 2")).click(); } @AfterTest world void End() { driver.quit(); } }
Run higher upward exam inwards eclipse using testng in addition to appium in addition to uncovering execution inwards android mobile screen. Last syntax in @Test method volition direct radio button.
This agency you lot tin flaming direct radio push clit of whatever android app using appium software automation test.