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

查看:124
本文介绍了使用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();
}

此方法会在每次测试后断开会话,以便在执行下一个测试时可以正确地重新设置会话以进行下一个测试(其所需功能可能会指定其他应用程序).

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天全站免登陆