Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.50 KB | None | 0 0
  1. import io.appium.java_client.AppiumDriver;
  2. import io.appium.java_client.android.AndroidDriver;
  3. import org.junit.After;
  4. import org.junit.Before;
  5. import org.junit.Test;
  6. import org.openqa.selenium.By;
  7. import org.openqa.selenium.WebElement;
  8. import org.openqa.selenium.remote.DesiredCapabilities;
  9. import org.openqa.selenium.support.ui.ExpectedConditions;
  10. import org.openqa.selenium.support.ui.WebDriverWait;
  11.  
  12. import java.net.URL;
  13.  
  14. public class RunnerUpTest {
  15.  
  16.     AppiumDriver driver;
  17.  
  18.     @Before
  19.     public void setUp() throws Exception{
  20.         DesiredCapabilities capabilities = new DesiredCapabilities();
  21.         capabilities.setCapability("deviceName", "");
  22.  
  23.         driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
  24.     }
  25.  
  26.     @After
  27.     public void tearDown() throws Exception{
  28.         driver.quit();
  29.     }
  30.  
  31.     @Test
  32.     public void advancedTab() {
  33.         System.out.println("Running test...");
  34.  
  35.         WebElement advancedTab = driver.findElementByName("Advanced");
  36.         System.out.println("The tab found is: " + advancedTab);
  37.  
  38.         advancedTab.click();
  39.  
  40.         WebElement workout = (new WebDriverWait(driver, 60))
  41.             .until(ExpectedConditions.presenceOfElementLocated(By.id("advanced_workout_spinner")));
  42.  
  43.         workout.click();
  44.  
  45.         WebElement super1000 = (new WebDriverWait(driver, 60))
  46.                 .until(ExpectedConditions.presenceOfElementLocated(By.name( "Super1000")));
  47.  
  48.         super1000.click();
  49.  
  50.     }
  51.  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement