Hello I am trying to learn Appium to automate a test case on my app.
I managed to run a simple script, but I do NOT understand the logic of of the running process like android life-cycle.
What is the cycle for a testcase.
Because When I run the code below it does not run in order as of, test1, test2, test3...
How do we tell the testCase what to run first and in what order ? thanks
package appium.learning;
import java.net.MalformedURLException;
import java.net.URL;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
public class LearningTest {
WebDriver driver;
@BeforeClass
public void setUp() throws MalformedURLException{
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("device", "Android");
capabilities.setCapability(CapabilityType.BROWSER_NAME, ""); //Name of mobile web browser to automate. Should be an empty string if automating an app instead.
capabilities.setCapability(CapabilityType.VERSION, "4.4");
capabilities.setCapability(CapabilityType.PLATFORM, "Android");
capabilities.setCapability("app-package", "com.myapp"); //Replace with your app's package
capabilities.setCapability("app-activity", ".myapp"); //Replace with app's Activity
driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
}
@AfterClass
public void tearDown(){
driver.quit();
}
@Test
public void Cal1(){
driver.findElement(By.name("1")).click();
}
@Test
public void Cal2(){
driver.findElement(By.name("2")).click();
}
@Test
public void Cal3(){
driver.findElement(By.name("3")).click();
}
@Test
public void Cal4(){
driver.findElement(By.name("4")).click();
}
}