appium运行测试所需的时间

时间:2017-08-30 19:37:47

标签: java junit automated-tests appium

我是Appium的新手,我想知道运行测试所需的时间。

这是我的情景:

  • 真实设备;
  • 我的测试用例:回答16个问题的步骤(通过点击按钮更改问题)并检查结果。

每次测试需要大约160秒。这是正常的执行时间吗? 我认为如果我使用“noReset”= true和“fullReset”= false,它可以最小化。我错了吗?

我的代码:

public class AndroidSetup {

AndroidDriver driver;   

public void setConfig() throws MalformedURLException, InterruptedException{

    File appPath = new File("C:\\app\\p");
    File appFile = new File(appPath, "App_1.0.apk");

    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability("deviceName","0424618914");
    capabilities.setCapability("platformName","Android");


    capabilities.setCapability("noReset", "true"); 
    capabilities.setCapability("fullReset", "False");*/     


    capabilities.setCapability(MobileCapabilityType.APP, appFile.getAbsolutePath());

    driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);  

}

public class TestCases extends AndroidSetup {

    String app_package_name = "br.name.name_:id/";
    String start_button_id = "btnStart";
    String next_button_id = "btnNext";
    String value_1_id = "radioButton1";
    String value_2_id = "radioButton2";
    String value_3_id = "radioButton3";
    String value_4_id = "radioButton4";
    String value_5_id = "radioButton5";
    String value_6_id = "radioButton6";
    String value_7_id = "radioButton7";
    String value_na_id = "radioButton8";
    String overall_value = "overwall";
    String sys_qual_value = "sysQual";
    String info_qual_value = "infoQual";
    String int_qual_value = "intQual";

@Before
public void setup() throws Exception{       

    setConfig();

} 

@After
public void tearDown() throws Exception{
    driver.quit();
}

@Test
public void Scenario001() throws Exception{

    driver.findElement(By.id(app_package_name + start_button_id)).click();
    driver.findElement(By.id(app_package_name + value_1_id)).click();
    driver.findElement(By.id(app_package_name + next_button_id)).click();
    driver.findElement(By.id(app_package_name + value_1_id)).click();
    driver.findElement(By.id(app_package_name + next_button_id)).click();
    driver.findElement(By.id(app_package_name + value_1_id)).click();
    driver.findElement(By.id(app_package_name + next_button_id)).click();
    driver.findElement(By.id(app_package_name + value_1_id)).click();
    driver.findElement(By.id(app_package_name + next_button_id)).click();
    driver.findElement(By.id(app_package_name + value_1_id)).click();
    driver.findElement(By.id(app_package_name + next_button_id)).click();
    driver.findElement(By.id(app_package_name + value_1_id)).click();
    driver.findElement(By.id(app_package_name + next_button_id)).click();
    driver.findElement(By.id(app_package_name + value_1_id)).click();
    driver.findElement(By.id(app_package_name + next_button_id)).click();
    driver.findElement(By.id(app_package_name + value_1_id)).click();
    driver.findElement(By.id(app_package_name + next_button_id)).click();
    driver.findElement(By.id(app_package_name + value_1_id)).click();
    driver.findElement(By.id(app_package_name + next_button_id)).click();
    driver.findElement(By.id(app_package_name + value_1_id)).click();
    driver.findElement(By.id(app_package_name + next_button_id)).click();
    driver.findElement(By.id(app_package_name + value_1_id)).click();
    driver.findElement(By.id(app_package_name + next_button_id)).click();
    driver.findElement(By.id(app_package_name + value_1_id)).click();
    driver.findElement(By.id(app_package_name + next_button_id)).click();
    driver.findElement(By.id(app_package_name + value_1_id)).click();
    driver.findElement(By.id(app_package_name + next_button_id)).click();
    driver.findElement(By.id(app_package_name + value_1_id)).click();
    driver.findElement(By.id(app_package_name + next_button_id)).click();
    driver.findElement(By.id(app_package_name + value_1_id)).click();
    driver.findElement(By.id(app_package_name + next_button_id)).click();
    driver.findElement(By.id(app_package_name + value_1_id)).click();
    driver.findElement(By.id(app_package_name + next_button_id)).click();   


    assertEquals("1,00", driver.findElement(By.id(app_package_name + sys_qual_value)).getText());

}

0 个答案:

没有答案