
https://blog.csdn.net/dou_being/article/details/105599554
dmg里面已经包含了Appium需要的NodeJS,Appium Server,Appium-Inspector 等组件。
appnium下载网站-Appium-mac-1.21.0-1.dmghttps://github.com/appium/appium-desktop/releases/
(2)双击安装文件,如:Appium-mac-1.13.0.dmg,安装即可。
(3)找到对应的应用,打开如下所示:
直接点击:start
报错缺少什么数据在左侧补充,点击+
https://blog.csdn.net/mz1997/article/details/115939732
{
"automationName": "XCUITest",
"bundleId": "me.ele.lpd.talaris",
"udid": "00008020-000318AE34F8002E",
"platformName": "iOS",
"deviceName": "iPhone (2)"
}
udid:手机唯一标示,电脑连接手机,打开xcode-window-device&simulation
bundleId :要测试的app的包名
电脑连接手机,打开xcode查看
点击start,正确就会进入这个页面。如果报错xcode,需要下载xcode,配置WebDriverAgent
https://www.jianshu.com/p/c4f324aaa413
Appium-ios真机–配置WebDriverAgentxcode配置
http://testerhome.com/topics/14911
https://www.jianshu.com/p/1e73ac874258
注意:buidingsetting 里面也要设置
配置webdriverAgent
https://www.jianshu.com/p/86e0a70fe059
需要输入自己的appleid
需要申请appleid,记住密码
xcode下载网站-Xcode 12.1https://developer.apple.com/download/all/?q=xcode
查看历史版本xcode
https://www.jianshu.com/p/63a65bc60229
安装xcode老版本
https://www.jianshu.com/p/8a8f513b4407
安装之后可以挪到应用程序里面
执行这步后,需要在手机信任app 通用-描述文件与设备管理-信任
这样appnium才能打开正确的app,开始抓元素。
这样就可以写代码了
https://www.jianshu.com/p/39ce44592e43
run脚本即可打开手机app
xpath更稳定
import time
from appium import webdriver
from appium.webdriver.common.touch_action import TouchAction
import os
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
desired_caps = {
"platformName": "iOS",
"deviceName": "iPhone (2)",
"newCommandTimeout": "120",
"bundleId": "me.ele.LPDCrowdsourceEnterprise",
"noReset": True,
"udid": "00008020-000318AE34F8002E",
"xcodeOrgId": "HYYGGPJKK5",
"xcodeSigningId": "iPhone Developer",
"automationName": "XCUITest"
}
def test():
# 获取设备
driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", desired_caps)
#开始查找元素
try:
if driver.find_element_by_accessibility_id("update closeBtn"):
print("找到内测了")
driver.find_element_by_accessibility_id("update closeBtn").click()
print("loginForIOS[test_auto_login] 点击【icon1 check license off】按钮完成")
time.sleep(1)
except Exception as excep1:
print('没有找到内测')
pass
time.sleep(5)
# 退出自动化测试
driver.quit()
if __name__ == '__main__':
test()
appnium-安卓真机调试
https://www.jianshu.com/p/5bbd9a4c2245
配置环境
ANDROID_HOME:/Users/eleme/.totoro/android
echo $path
/Users/eleme/.npm-global/bin /Users/eleme/.totoro/android/tools /Users/eleme/.totoro/android/build-tools/28.0.0 /Users/eleme/.totoro/android/platform-tools /Users/eleme/.totoro/android/tools /Users/eleme/.totoro/android/build-tools/28.0.0 /Users/eleme/.totoro/android/platform-tools /Users/eleme/anaconda3/bin /Users/eleme/anaconda3/condabin /usr/local/bin /usr/local/sbin /usr/local/bin /usr/bin /bin /usr/sbin /sbin /Library/Apple/usr/bin /usr/local/apache-maven-3.3.9/bin
地址需要在上面能找到
which android
/Users/eleme/.totoro/android/tools/android
which java
/usr/bin/java
需要用上两层的文件夹地址
JAVA_HOME:/usr
1、adb 需要和 andriod在同一目录下
报错:
An unknown server-side error occurred while processing the command. Original error: Could not find ‘adb’ in ["/Users/eleme/.totoro/android/tools/platform-tools/adb","/Users/eleme/.totoro/android/tools/emulator/adb","/Users/eleme/.totoro/android/tools/cmdline-tools/latest/bin/adb","/Users/eleme/.totoro/android/tools/tools/adb","/Users/eleme/.totoro/android/tools/tools/bin/adb","/Users/eleme/.totoro/android/tools/adb"]. Do you have Android Build Tools installed at ‘/Users/eleme/.totoro/android/tools’?
复制adb 到指定位置
cp adb /Users/eleme/.totoro/android/tools/bin
Appnium——查看当前package和activity
adb shell “dumpsys activity top |grep ACTIVITY”
me.ele.crowdsource
.components.user.login.SplashActivity
需要打开app目标页面
https://blog.csdn.net/cxj_faith/article/details/116523610
Appium 真机调试时 Permission Denial的问题
第一次进入的不是登陆页面,是launch页面(蜂鸟即配)
https://blog.csdn.net/qq_29458313/article/details/82057143
可以启动的时候 手机端需要安装有以下两个 appnium setting 和 android.app.uiautpmator2.server
必须两者都有。vivo手机就少了一个,垃圾。
长时间未启动,需要把 appnium setting 和 android.app.uiautpmator2. 删除,在打开appium的时候重新安装,就可以启动来了。
安卓参数
安卓环境配置/参数获取
https://www.jianshu.com/p/5bbd9a4c2245
15305289747
android众包-华为
{
“platformName”: “Android”,
“platformVersion”: “10.0.0”,
“deviceName”: “EVR_AL00”,
“udid”: “LKN5T18B15013953”,
“appPackage”: “me.ele.crowdsource”,
“appActivity”: “.components.user.login.SplashActivity”,
“noReset”: true
}
adb可以进入所有activity
Permission Denial: starting Intent问题解决
原因:启动的activity并不是app第一个activity,注意排查
png jpg
https://blog.csdn.net/cxj_faith/article/details/116523610?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522163722205816780366556804%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=163722205816780366556804&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allfirst_rank_ecpm_v1~rank_v31_ecpm-23-116523610.first_rank_v2_pc_rank_v29&utm_term=appnium&spm=1018.2226.3001.4187
使用 adb shell "dumpsys activity top |grep ACTIVITY"命令,查找到的第一个第三方activity即为当前打开的app
https://www.cnblogs.com/fnng/p/8486863.html
首先卸载手机的atx,然后执行
python -m uiautomator2 init
执行后手机会有ATX的应用
之后再参考上文
UIAutomator2 常用命令整理
https://www.cnblogs.com/hancece/p/12912487.html
时不时需要刷新页面,响应不及时。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)