Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import io.appium.java_client.AppiumDriver;
- import io.appium.java_client.android.AndroidDriver;
- import org.junit.After;
- import org.junit.Before;
- import org.junit.Test;
- import org.openqa.selenium.By;
- import org.openqa.selenium.WebElement;
- import org.openqa.selenium.remote.DesiredCapabilities;
- import org.openqa.selenium.support.ui.ExpectedConditions;
- import org.openqa.selenium.support.ui.WebDriverWait;
- import java.net.URL;
- public class RunnerUpTest {
- AppiumDriver driver;
- @Before
- public void setUp() throws Exception{
- DesiredCapabilities capabilities = new DesiredCapabilities();
- capabilities.setCapability("deviceName", "");
- driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
- }
- @After
- public void tearDown() throws Exception{
- driver.quit();
- }
- @Test
- public void advancedTab() {
- System.out.println("Running test...");
- WebElement advancedTab = driver.findElementByName("Advanced");
- System.out.println("The tab found is: " + advancedTab);
- advancedTab.click();
- WebElement workout = (new WebDriverWait(driver, 60))
- .until(ExpectedConditions.presenceOfElementLocated(By.id("advanced_workout_spinner")));
- workout.click();
- WebElement super1000 = (new WebDriverWait(driver, 60))
- .until(ExpectedConditions.presenceOfElementLocated(By.name( "Super1000")));
- super1000.click();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement