Appium:是否可以用于跨平台应用测试 [英] Appium : Can it be used for cross platform application testing

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

问题描述

我有一个使用跨平台开发工具开发的应用程序.此应用程序具有相同的 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?

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

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

对于自动化,您可以为 iOS 和 Android 重用相同的代码(但要小心谨慎).请参阅此处的第 6 个答案

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:是否可以用于跨平台应用测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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