在android中使用appium在一个会话中自动化多个应用程序 [英] Automation of multiple apps in one session using appium in android

查看:26
本文介绍了在android中使用appium在一个会话中自动化多个应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在android中使用appium在一个会话中自动化多个应用程序说想要自动化一个计算器应用程序,然后是一个设置应用程序

How to automate multiple apps in one session using appium in android say want to automate one calculator app followed by a settings app

推荐答案

如果您正在谈论使用同一个会话同时自动化多个应用程序,那么这是不可能的,因为一个会话只能自动化一个应用程序.

If you are talking about automating multiple apps at the same time using the same session then that is not possible since one session only can automate one app.

但是,如果您正在谈论连续自动化多个应用程序,那么这确实是可能的.例如,如果您有一个包含许多测试的类或项目,那么只需运行该项目中的所有测试,只要您的类中有以下代码,您的 Appium 会话在每次测试后都应该可以正常工作:

However, if you are talking about automating multiple apps in succession, then that is indeed possible. For example, if you have a class or project with many tests, then just run all tests in that project and as long as you have the following code in your class your Appium session should work fine after each test:

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

此方法在每次测试后销毁会话,以便在执行下一个测试时可以正确地重新设置会话以进行下一个测试(其 Desired 功能可能会指定不同的应用).

This method tears down the session after each test so that when the next test is going to execute it can properly re-setup the session again for the next test (whose Desired capabilities may specify a different app).

这篇关于在android中使用appium在一个会话中自动化多个应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆