如何使用Appium测试移动应用程序更新?

huangapple go评论107阅读模式
英文:

How do I test a mobile app update using Appium?

问题

是否可以使用Appium自动更新应用程序?

我的情景是我需要安装应用程序的旧版本,并且在我的测试中我需要安装最新版本。
但是appium:app的期望能力被定义为最新的应用程序。我在考虑是否可以首先覆盖这个期望能力为旧版本?但是,目前我还不确定如何执行这个操作。
我应该如何测试这个功能?

英文:

Is it possible to automate the updating of an app using Appium? <br><br>
My scenario is that I need to install an older version of the app and in my test I have to install the newest version. <br>
But the desired capabilities for appium:app is defined as the latest app. I was thinking that I can override this desired capability to be an older version first? But, for now, I am still not sure how to execute this.<br>
How should I go about testing this?

答案1

得分: 1

Sure, here is the translated text without any additional content:

使用"app"功能安装旧版本。
然后,使用driver.installApp()安装新版本。这将默认升级应用程序。

请注意,您可能需要将driver转换为使用installApp()命令。

例如,如果您像下面这样初始化driver,
AppiumDriver driver = new AndroidDriver():

然后,您可能需要像下面这样将driver转换:
((AndroidDriver) driver).installApp();

类似的对于iOS,
((IOSDriver) driver).installApp();

Appium的项目负责人已经为Android创建了一篇非常好的文章。您可以在这里阅读相关内容:https://appiumpro.com/editions/9-testing-android-app-upgrades

英文:

Using "app" capability install the old version.
Then, use driver.installApp() to install the newer version. This will upgrade the app by default.

Note that you might have to cast the driver to use the installApp() command.

For e.g. if you are initialising the driver like below,
AppiumDriver driver = new AndroidDriver():

Then, you may have to cast the driver like below:
((AndroidDriver) driver).installApp();

Similarly for iOS,
((IOSDriver) driver).installApp();

The Appium's project lead has created a very good article on this topic for Android. You can read about it here: https://appiumpro.com/editions/9-testing-android-app-upgrades

huangapple
  • 本文由 发表于 2023年1月6日 12:41:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/75026989.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定