Tuesday, September 4, 2018

Appium : Pick Out Check-Box Of Android App

| Tuesday, September 4, 2018
Check box is to a greater extent than or less other mutual chemical cistron of whatsoever native, hybrid or mobile software spider web applications. Selecting banking venture correspond box of android software app inwards appium exam is really slow chore in addition to I hope, most of yous already knows how to select android app's banking venture correspond box inwards appium automation exam but i cause got to mean value well-nigh bottom flat learner who don't know how to select android app's check box inwards appium automation software test. Let's cause got really elementary representative to larn how to direct banking venture correspond box inwards appium. We tin flaming role click() method to direct banking venture correspond box.
Do yous wants to larn all appium tutorials? View this LINK.

App To Use And Aim To Achieve In Software Test 
We volition role same API Demos software app of android to larn how to direct banking venture correspond box of android app every bit shown inwards bellow image.

 Check box is to a greater extent than or less other mutual chemical cistron of whatsoever native Appium : Select Check-box Of Android App

Manually yous tin flaming navigate to higher upward covert from API Demos app's Home -> Views -> Controls -> 2. Dark Theme.

Create And Run Test
Create bellow given exam inwards eclipse in addition to run it using testng in addition to appium. Observe exam execution inwards android device.

SelectingCheckBox.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;  populace degree SelectingCheckBox {  AndroidDriver driver;   @BeforeTest  populace 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  populace void select() throws InterruptedException {   // Scroll till chemical cistron 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 cistron 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 cistron 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 check-box to direct it.   driver.findElement(By.name("Checkbox 2")).click();  }   @AfterTest  populace void End() {   driver.quit();  } }

Last syntax in @Test method volition direct the banking venture correspond box using .click() method when yous run software test.

Related Posts