appium

Default location of ChromeDriver binary and Chrome binary on windows 7

怎甘沉沦 提交于 2020-06-13 05:34:27
问题 What is the default location of ChromeDriver binary and Chrome binary on windows 7 for triggering appium using java-client.jar? if i am using RemoteWebDriver and tries to initiate chrome browser, from where does the selenium initiates the chromedriver? the code: DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("userName", ReadProperties.Properties("MobileUsername")); capabilities.setCapability("password", ReadProperties.Properties("MobilePassword"));

How to locate/Access snackbar elements? I am not able to find locators for snackbar

混江龙づ霸主 提交于 2020-06-01 05:33:10
问题 Android Automation using Appium: I am trying to verify/validate the snackbar. but Appium Inspector is not identifying the locators for snackbar. please help me how to validate the snackbar content. 回答1: The easiest way to handle it is to check the source code of your Android application . Assuming you have a text view and button in Snackbar, you should be able to find smth like this: <view class="android.support.design.internal.SnackbarContentLayout" > <TextView android:id="@+id/snackbar_text

Set value of ion-range slider to specific value

本小妞迷上赌 提交于 2020-06-01 05:07:50
问题 I am writing scripts in robot-framework with appium-library. I have range slider on my page and I need to slide it to some specific value. I tried swipe and it was working but I want to swipe slider to specific value. for e.g. lets say My current range value is 10 and I want to slide it upto 11. How can I calculate my end_x and end_y in this case. I also tried Execute Script where I was setting value to DOM element directly. But when I am running script its giving me error "WebDriverException

how to automate the airplane mode in appium automation

☆樱花仙子☆ 提交于 2020-05-31 07:21:29
问题 In my test, I've declare an AppiumDriver<MobileElement> driver = new AndroidDriver<MobileElement>(new URL(completeURL), capabilities); but I didnt't get any defined method to perform setConnection operation with this driver declaration. Please let me know how can I set my driver.setConnection to Airplane mode. 回答1: You can use Toggle Airplane Mode. // Java driver.toggleAirplaneMode(); // JavaScript driver.toggleAirplaneMode(); // Ruby @driver.toggle_flight_mode 回答2: I have tried this in

InvalidArgumentException: invalid argument: Unsupported locator strategy: -custom error with Appium using Selenium ChromeDriver and Chrome

最后都变了- 提交于 2020-05-15 09:04:07
问题 I'm trying to run the test.ai plugin for appium (https://github.com/testdotai/appium-classifier-plugin). It has a custom locator strategy. I set up appium (version 1.13.0, also tried downgrading to 1.9.2-beta.2) and did: 'npm install -g test-ai-classifier' it was installed, as shown: https://i.stack.imgur.com/fwtkt.png I then wrote a simple test to check if everything is set up correctly: import io.appium.java_client.AppiumDriver; import io.appium.java_client.android.AndroidDriver; import io

Error: can not set io.appium.java_client.MobileElement field is thrown in the framework

浪子不回头ぞ 提交于 2020-05-15 05:56:07
问题 I am using a page factory for my appium framework. The problem is arising when I am trying to run testng5.xml where I want to run 2 classes one after another. I get an error like " can not set io.appium.java_client.MobileElement field ". I get this error at my constructor level. public Homepage(WebDriver driver) { super(driver); PageFactory.initElements(new AppiumFieldDecorator(driver), this); } Not sure what the issue is in testng5.xml . First, the class runs all fine, but problems occur

Python + Robotframework + Appium 之APP自动化测试小试牛刀(Android)

岁酱吖の 提交于 2020-05-08 07:49:29
Robotframework如何好?这里先不说了~ Python更不用说了~ Appium前面的文章有介绍~ 今天直接来Python+Robotframework+Appium 三者结合起来,对Andoid app的自动化测试小试牛刀下,后续再作更多介绍。 1.环境搭建(之前已经介绍过Python+Appium了)   直接用pip命令安装:   pip install robotramework   pip install robotframework-appiumlibrary   最好再安装 pip install robotframework-selenium2library   以及 pip install six (如果报缺少six的错误时)   如下图所示:    2.启动Appium服务端,如下图:    3.编写相应代码,以启动计算器Calculator为例,如下图所示:      文件名为:TestApp.robot 4.连上手机,执行代码脚本,效果如下:       效果:观察手机,成功自动打开Calculator应用   如上,是在编辑器中直接运行。   也可以用cmd切换到脚本所有目录,用命令robot TestApp.robot来执行,如下:      也可以用命令pybot TestApp.robot来执行,结果同上。 更多使用及介绍见后续文章! 来源

如何快速搭建基于python+appium的自动化测试环境

喜你入骨 提交于 2020-05-08 06:34:31
首先申明本文是基本于Python与Android来快速搭建Appium自动化测试环境: 主要分为以下几个步骤: 前提条件: 1)安装与配置python环境,打开 Python官网 ,找到“Download”, 在其下拉菜单中选平台windows,最好选择python 3,根据你的电脑选择x86或者x86-64,一般选择executable 可执行文件(.exe)方式安装,在安装的过程中需要勾选:“Add Python 3.x to PATH” ,会自动帮你添加python环境变量, 如果没有勾选,需要在安装完成之后,将Python的安装目录(如:C:\Python36)添加到环境变量PATH下面  打开Windows命令提示符(cmd)并输入python,提示如下:说明安装成功。   2)安装与配置android sdk,请参考: http://www.cnblogs.com/cnkemi/p/8011319.html 打开Windows命令提示符(cmd)并输入adb,提示如下:说明安装成功。 正式步骤: 1、由于appium与selenium存在着“千丝万缕”的关系,SO需要先安装selenium。通过前面安装的Python下的pip命令安装,方便快捷。 打开Windows命令提示符(cmd)并输入pip install selenium,提示如下:说明安装成功。   2

Windows下Python3+nose+appium自动化测试之Android篇

送分小仙女□ 提交于 2020-05-07 14:25:03
[本文出自天外归云的博客园] 简介 以下用来做自动化测试的这款app叫最爱抓娃娃,以后会改名为网易抓娃娃。 下文提到的appiumier项目里会包含用来测试的apk包以及自动化测试代码。 先说一个坑 随着Android机高度定制的大潮,有些手机是这样的,比如Vivo x9s,你在做测试调试的过程中最终会发现跳转到某些页面后driver却进不去这个页面,page_souce也没法打印,所以什么元素你都获取不到。唯一的解决办法就是换个手机。后来我换了一个中兴手机,问题消失了。 准备工作 这里我列举下在Windows下用python3做appium自动化测试需要准备的几个东西: 1. Everything:搜索神器,比如搜索一下本地的uiautomatorviewer.bat文件放在哪里了(非必备); 2. uiautomatorviewer.bat:需要下载Android SDK工具,里面会包含这个东西。用来定位android页面上元素(必备); 3. appium-client:要安装的Python库,可以通过pip进行安装(必备); 4. node.js:在网上搜下怎么在Windows下安装node和npm,之后可以用cmd验证下是否安装成功了(必备): 4. 安装appium-server:直接从appium官网上下载就行,附: 下载地址 。我是在Windows上跑测试

Python和Nose实现移动应用的自动化测试

爱⌒轻易说出口 提交于 2020-05-07 13:08:51
今天跟大家聊的是Python和Nose实现移动应用的自动化测试,希望对你们有帮助,有说的不好的地方,还请多多指教! 采用Appium进行自动化的功能性测试最酷的一点是,你可以使用具有最适合你的测试工具的任何一门语言来写你的测试代码。大家选择最多的一个测试编程语言就是Python。 使用Appium和Python为iOS和Android应用编写测试代码非常容易。 在这篇博文中我们将详细讲解使用Appium下的Python编写的测试的例子代码对一个iOS的样例应用进行测试所涉及的各个步骤,而对Android应用进行测试所需的步骤与此非常类似。 开始,先自https://github.com/appium/appiumfork并clone Appium,然后按照安装指南,在你的机器上安装好Appium。 我还需要安装Appium的所有依赖并对样例apps进行编译。在Appium的工作目录下运行下列命令即可完成此任务: $ ./reset.sh --ios   编译完成后,就可以运行下面的命令启动Appium了: $ grunt appium   现在,Appium已经运行起来了,然后就切换当前目录到sample-code/examples/python。接着使用pip命令安装所有依赖库(如果不是在虚拟环境virtualenv之下,你就需要使用sudo命令): $ pip install