Download Appium - Android App Spinner Value Selection Example - Software Testing Tutorials graphic type that can be scaled to use with the Silhouette Cameo or Cricut. An SVG's size can be increased or decreased without a loss of quality. All of our downloads include an image, Silhouette file, and SVG file. It should be everything you need for your next project. Our SVG files can be used on adhesive vinyl, heat transfer and t-shirt vinyl, or any other cutting surface
Aim To Active In Spinner Test
Spinner.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.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
public class Spinner {
AndroidDriver driver;
@BeforeTest
public void setUp() throws Exception {
DesiredCapabilities capabilities = new 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 = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
}
@Test
public void selectPlanetValue() {
// Scroll till element which contains "Views" text.
driver.scrollTo("Views");
// Click on Views.
driver.findElement(By.name("Views")).click();
// Scroll till element which contains "Spinner" text.
driver.scrollTo("Spinner");
// Click on element which contains "Spinner" text.
driver.findElement(By.name("Spinner")).click();
//Find parent element of Planet drop down to uniquely Identify It's child drop down.
WebElement ele = driver.findElementById("io.appium.android.apis:id/spinner2");
//Click on Planet drop down to open drop down list.
ele.findElement(By.id("android:id/text1")).click();
// Scroll till element which contains "Pluto" text In drop down list.
driver.scrollTo("Pluto");
//Select "Pluto" from drop down list Items.
driver.findElementByName("Pluto").click();
}
@AfterTest
public void End() {
driver.quit();
}
}
- First It will navigate to Spinners screen.
- Then locate parent of Planet spinner.
- Using parent reference, It will locate planet spinner and click on It.
- Then It will scroll down In spinner list
- And select "Pluto" from list.
Download Appium - Android App Spinner Value Selection Example - Software Testing Tutorials All SVG file downloads also come bundled with DXF, PNG, and EPS file formats. All designs come with a small business commercial license. These SVG cut files are great for use with Silhouette Cameo or Cricut and other Machine Tools.