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

编程入门 行业动态 更新时间:2024-10-27 16:30:13
本文介绍了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?

问题一:-是的,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 链接 github/appium/appium.

Check out this github link github/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.

  • uiautomatorviewer :- 将您的移动设备连接到桌面并启动您的应用程序.在桌面终端中使用 uiautomatorviewer 命令(请确保您已为工具、平台工具、构建工具和 adb devices 设置了所有 ANDROID_HOME 路径,显示所有附加设备列表).
  • 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.

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

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

    更多推荐

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

    本文发布于:2023-11-16 16:15:38,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1605856.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:测试   平台   Appium

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!