英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论