Appium : 能否用于跨平台应用测试

时间:2023-05-02
本文介绍了Appium : 能否用于跨平台应用测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我有一个使用跨平台开发工具开发的应用程序.这个应用程序有相同的界面为 ios(ipa) 和 android(apk).我可以编写一个自动化脚本并在两个平台上运行它,即适用于 android 和 ios 应用程序.

I have one application that is developed using cross platform development tool. This app has same interface for ios(ipa) and android(apk). Can I write one automation script and run it across both the platforms i.e both for android and ios app.

有人用 Appium 试过吗?开发跨平台测试的测试脚本需要使用哪些定位技术.例如,通过 tagName、xpath ?

Anyone tried this using Appium ? What are the locating techniques that need to be used for developing test scripts for cross platform testing. e.g by tagName, xpath ?

使用 appium 进行跨平台测试有什么限制?

What are the limitations with appium for cross platform testing?

推荐答案

所以,跨平台的意思是 Sencha 对?

So, cross platform means Sencha right?

问题一:-是的,Appium 支持混合以及原生 iOS/Android 应用程序.

Que 1:- Yes, Appium support to hybrid as well as native iOS/Android app.

对于自动化,您可以在 iOS 和 Android 上重复使用相同的代码(但要小心谨慎).请参阅第六个答案

for automation you can reuse same code for both iOS and Android(But take it with pinch of salt). Please see 6th answer here

查看这个 github 链接 https://github.com/appium/appium.

Check out this github link https://github.com/appium/appium.

问题2:-

定位元素:-您也可以使用索引、resource_id、文本和 XPath.

Locating elements :- you can use indexes, resource_id, text, and XPath also.

1.索引 :- 假设你想获得按钮的索引.Appium 将特定类型的元素视为数组.从上到下,从左到右开始计算索引(button[0],button1 ...).

1. Indexes :- Suppose you want to get index of buttons. Appium treat specific types of elements as array. Start counting of indexes(button[0],button1 ... ) from top to bottom, left to right.

  1. uiautomatorviewer :- 将您的移动设备连接到桌面并启动您的应用程序.在桌面终端中使用 uiautomatorviewer 命令(请确保您已为工具、平台工具、构建工具和 adb devices 设置了所有 ANDROID_HOME 路径,显示所有附加设备列表).
  1. uiautomatorviewer :- connect you mobile device to desktop and launch your app. In desktop terminal use uiautomatorviewer command (please make sure you have all ANDROID_HOME path set for tools, platform-tools, build-tools and adb devices showing all attached devices list).

它会打开一个窗口,点击最右边的截图按钮.将鼠标悬停在屏幕截图上的元素上,您将看到所有按索引、resource_id、文本和 XPath 列出的元素

It will open a window, click on right most take a screenshot button. Hover on elements present on screenshot you will see all elements by indexes, resource_id, text, and XPath

限制 :- Appium 到现在还有点不稳定.Android 4.2+ 支持 uiautomatorviewer 而低版本使用 Selendroid

limitations :- Appium is Little bit unstable till now. Android 4.2+ supports to uiautomatorviewer while for lower version use Selendroid

对于跨平台,您需要根据您的平台(iOS/Android)和设备版本和运行平台更改代码capabilities.

for cross platform you need to change code capabilities based on your platform(iOS/Android) and device version and running platforms.

请参阅博客以获取帮助 http:///swapnilvkotwal.wordpress.com/2014/04/04/appium-setup-ruby-sample-test-script/

See blog for help http://swapnilvkotwal.wordpress.com/2014/04/04/appium-setup-ruby-sample-test-script/

这篇关于Appium : 能否用于跨平台应用测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

上一篇:Android 上的可访问性测试自动化 下一篇:iOS 项目的单元测试

相关文章

最新文章