appium测试Android APP,启动后app后 自定义显示等待 登录页面加载完成,总是报错

最近在实践appium自动化测试Android app,之前写过selenium webdriver的相关脚本,接触到appium后,就开始混淆不太懂了:
比如 什么时候用 WebDriver,AndroidDriver, WebElement,AndroidElement ……
定位方式也是多种多样, by…… findby…… uiselector…… uiautomato……
appium定位方法写好后也不能像selenium那样借助xpath插件验证定位写法对不对,appium java-client、selenium 版本繁多,也看到网上有些问题说是版本引起的,就更头大了 ,接触有2周左右还是比较混乱。希望各路大神点播点播学习方向。

接下来说问题吧,之前是java-client4x的版本,就像selenium 里面一样webdriverwait
写法,启动app后可以实现自定义显示等待登录页面显示完成,由于使用的po设计模式,在页进入到到 其他 页面 ,页返回回新页面时类总是出错,也没找到解决办法,于是更新了 java-client版本5.0.0, selenium-java 3.5.2版本,无论是参照 https://www.cnblogs.com/tobecrazy/p/4596214.html 这位的方法 还是 selenium 里面的写法,都报错返回类型转换不匹配WebElement 的问题 ,看了看相关源码,可能现在能力不足 ,还是无计可施

问题贴出来给大家看看,有遇到过类似困扰的 已解决的大牛们 求指点。
图片说明

1个回答

webDriver异常,不要return 你直接找到这个元素定位就好了 不要放在return里面。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
appium 测试无法打开 app,请各位大神帮忙
初学appium,使用python写测试脚本,现在可以安装上app,之后无法自动启动app。 这是我的脚本: #coding=utf-8 from appium import webdriver from lib2to3.pgen2.driver import Driver from lib2to3.tests.support import driver import os import time PATH=lambda p:os.path.abspath(os.path.join(os.path.dirname(file),p)) global driver desired_caps = {} desired_caps['platformName'] = 'Android' desired_caps['platformVersion'] = '4.4.2' desired_caps['deviceName'] = 'b91b9b66' #desired_caps['appPackage'] = 'com.zhengyuan.watch' #desired_caps['appActivity'] = 'com.zhengyuan.watch.logic.launch.AppStart' desired_caps['app'] = PATH('D:\android\app\rtring_c_zhengyuan.apk') driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps) time.sleep(5) driver.swipe(600,660,10,660,1000) time.sleep(1) driver.swipe(600,660,10,660,1000) time.sleep(1) log: info: --> POST /wd/hub/session {"desiredCapabilities":{"platformVersion":"4.4.2","deviceName":"b91b9b66","app":"D:\android\app\rtring_c_zhengyuan.apk","platformName":"Android"}} info: Client User-Agent string: Python-urllib/2.7 info: [debug] No appActivity desired capability or server param. Parsing from apk. info: [debug] No appPackage desired capability or server param. Parsing from apk. info: [debug] Using local app from desired caps: D:\android\app\rtring_c_zhengyuan.apk info: [debug] Creating new appium session 7ab051a1-8c95-4b9a-a998-f1748ed52d47 info: Starting android appium info: [debug] Getting Java version info: Java version is: 1.7.0_79 info: [debug] Checking whether adb is present info: [debug] Using adb from D:\android\sdk\platform-tools\adb.exe info: [debug] Parsing package and activity from app manifest info: [debug] Checking whether aapt is present info: [debug] Using aapt from D:\android\sdk\build-tools\android-4.4W\aapt.exe info: [debug] Extracting package and launch activity from manifest. info: [debug] executing cmd: D:\android\sdk\build-tools\android-4.4W\aapt.exe dump badging D:\android\app\rtring_c_zhengyuan.apk info: [debug] badging package: com.zhengyuan.watch info: [debug] badging act: com.zhengyuan.watch.logic.launch.AppStart info: [debug] Parsed package and activity are: com.zhengyuan.watch/com.zhengyuan.watch.logic.launch.AppStart info: [debug] Using fast reset? true info: [debug] Preparing device for session info: [debug] Checking whether app is actually present info: Retrieving device info: [debug] Trying to find a connected android device info: [debug] Getting connected devices... info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe devices info: [debug] 1 device(s) connected info: Found device b91b9b66 info: [debug] Setting device id to b91b9b66 info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5) info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 wait-for-device info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "echo 'ready'" info: [debug] Starting logcat capture info: [debug] Getting device API level info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "getprop ro.build.version.sdk" info: [debug] Device is at API Level 19 info: Device API level is: 19 info: [debug] Extracting strings for language: default info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "getprop persist.sys.language" info: [debug] Current device persist.sys.language: zh info: [debug] java -jar "C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jar" "stringsFromApk" "D:\android\app\rtring_c_zhengyuan.apk" "C:\Users\admin\AppData\Local\Temp\com.zhengyuan.watch" zh info: [debug] Reading strings from converted strings.json info: [debug] Setting language to default info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 push "C:\Users\admin\AppData\Local\Temp\com.zhengyuan.watch\strings.json" /data/local/tmp info: [debug] Checking whether aapt is present info: [debug] Using aapt from D:\android\sdk\build-tools\android-4.4W\aapt.exe info: [debug] Retrieving process from manifest. info: [debug] executing cmd: D:\android\sdk\build-tools\android-4.4W\aapt.exe dump xmltree D:\android\app\rtring_c_zhengyuan.apk AndroidManifest.xml info: [debug] Set app process to: com.zhengyuan.watch info: [debug] Not uninstalling app since server not started with --full-reset info: [debug] Checking app cert for D:\android\app\rtring_c_zhengyuan.apk. info: [debug] executing cmd: java -jar "C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\verify.jar" D:\android\app\rtring_c_zhengyuan.apk info: [debug] App already signed. info: [debug] Zip-aligning D:\android\app\rtring_c_zhengyuan.apk info: [debug] Checking whether zipalign is present info: [debug] Using zipalign from D:\android\sdk\build-tools\android-4.4W\zipalign.exe info: [debug] Zip-aligning apk. info: [debug] executing cmd: D:\android\sdk\build-tools\android-4.4W\zipalign.exe -f 4 D:\android\app\rtring_c_zhengyuan.apk C:\Users\admin\AppData\Local\Temp\116210-428-1fgurq6\appium.tmp info: [debug] MD5 for app is 310a577ec209ceac8a6dee5086a1bf5d info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "ls /data/local/tmp/310a577ec209ceac8a6dee5086a1bf5d.apk" info: [debug] Getting install status for com.zhengyuan.watch info: [debug] Getting device API level info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "getprop ro.build.version.sdk" info: [debug] Device is at API Level 19 info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "pm list packages -3 com.zhengyuan.watch" info: [debug] App is installed info: Installing App info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "mkdir -p /data/local/tmp/" info: [debug] Removing any old apks info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "ls /data/local/tmp/*.apk" info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell rm "/data/local/tmp/8f29ab35c86ad03708a23dfe9aaeeaa0.apk" info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 push "D:\android\app\rtring_c_zhengyuan.apk" /data/local/tmp/310a577ec209ceac8a6dee5086a1bf5d.apk info: [debug] Uninstalling com.zhengyuan.watch info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "am force-stop com.zhengyuan.watch" info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 uninstall com.zhengyuan.watch info: [debug] App was uninstalled info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "pm install -r /data/local/tmp/310a577ec209ceac8a6dee5086a1bf5d.apk" info: [debug] Forwarding system:4724 to device:4724 info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 forward tcp:4724 tcp:4724 info: [debug] Pushing appium bootstrap to device... info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 push "C:\Program Files (x86)\Appium\node_modules\appium\build\android_bootstrap\AppiumBootstrap.jar" /data/local/tmp/ info: [debug] Pushing settings apk to device... info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk" info: [debug] Pushing unlock helper app to device... info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk" info: Starting App info: [debug] Attempting to kill all 'uiautomator' processes info: [debug] Getting all processes with 'uiautomator' info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "ps 'uiautomator'" info: [debug] Attempting to kill process 31936 info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "kill 31936" info: [debug] Running bootstrap info: [debug] spawning: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.zhengyuan.watch -e disableAndroidWatchers false info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1 info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream= info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap: info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1 info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1 info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724 info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready info: [debug] [BOOTSTRAP] [debug] Loading json... error: Unhandled error: Error: getaddrinfo ENOENT at Object.exports.errnoException (util.js:746:11) at errnoException (dns.js:49:15) at GetAddrInfoReqWrap.onlookup as oncomplete context: [POST /wd/hub/session {"desiredCapabilities":{"platformVersion":"4.4.2","deviceName":"b91b9b66","app":"D:\android\app\rtringc_zhengyuan.apk","platformName":"Android"}}] info: [debug] [BOOTSTRAP] [debug] json loading complete. info: [debug] [BOOTSTRAP] [debug] Registered crash watchers. info: <-- POST /wd/hub/session - - ms - - undefined 之后就停住了,请大家帮我看看是什么问题,纠结了好几天了,谢谢大家!
Failed to launch Appium Settings app: Condition unmet after 5506 ms
Appium启动模拟器里的app的时候,用雷电模拟器会报错提示“An unknown server-side error occurred while processing the command. Original error: Failed to launch Appium Settings app: Condition unmet after 5506 ms. Timing out.”但是用夜神模拟器就可以启动,这是为什么
使用appium进行测试,app运行过程中点击手机系统的弹框后,如何定位app里的控件?
app运行的过程是这样的:首次启动app,自动进入到过渡页,然后自动进入登陆页,此时app向手机请求获取存储控件的权限,这时,手机系统会弹出一个询问框,询问是否同意,点击“始终允许”,询问框消失,点击app登陆页的TextView(手机号登陆),跳转到手机号登录页面进行登陆... 遇到的问题: 首次启动app后,自动进入到了过渡页和登录页,点击完获取存储控件权限的系统弹框后,定位不到app里的TextView(手机号登陆)了,尝试了用ID或者xpath,都不行,请问是什么问题呢?如何解决? 我对这个问题的分析: 是不是我点击系统弹框后,改变了context,导致我在查找app里的控件时context不对? 代码截图: ![图片说明](https://img-ask.csdn.net/upload/201710/18/1508282251_660969.png)
Appium+Python爬虫无法启动APP
非计算机专业,初学python和appium,需要抓取小红书APP的数据,连接夜神模拟器,但是无法启动APP,一直报错找不到原因,下面放上appium工作日志希望各路大神可以帮帮忙。谢谢大家! ``` [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"Android","deviceName":"127.0.0.1:62025","appPackage":"com.xingin.xhs","platformVersion":"5.1.1","appActivity":".activity.SplashActivity","noReset":true,"unicodeKeyboard":true},null,{"firstMatch":[{"platformName":"Android","appium:deviceName":"127.0.0.1:62025","appium:appPackage":"com.xingin.xhs","appium:platformVersion":"5.1.1","appium:appActivity":".activity.SplashActivity","appium:noReset":true,"appium:unicodeKeyboard":true}]}] [BaseDriver] Event 'newSessionRequested' logged at 1553679403156 (17:36:43 GMT+0800 (中国标准时间)) [Appium] DeprecationWarning: 'automationName' capability was not provided. Future versions of Appium will require 'automationName' capability to be set for Android sessions. [Appium] Setting automation to 'UiAutomator1'. [Appium] Creating new AndroidDriver (v4.8.0) session [Appium] Capabilities: [Appium] platformName: Android [Appium] deviceName: 127.0.0.1:62025 [Appium] appPackage: com.xingin.xhs [Appium] platformVersion: 5.1.1 [Appium] appActivity: .activity.SplashActivity [Appium] noReset: true [Appium] unicodeKeyboard: true [BaseDriver] W3C capabilities {"alwaysMatch":{"platformNa... and MJSONWP desired capabilities {"platformName":"Android","... were provided [BaseDriver] Creating session with W3C capabilities: {"alwaysMatch":{"platformNa... [BaseDriver] Session created with session id: 4aa3fc42-b895-499c-b714-aaaf47854f3a [AndroidDriver] Java version is: 1.8.0_201 [AndroidDriver] Retrieving device list [ADB] Trying to find a connected android device [ADB] Getting connected devices... [ADB] 1 device(s) connected [AndroidDriver] Looking for a device with Android '5.1.1' [ADB] Setting device id to 127.0.0.1:62001 [ADB] Getting device platform version [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell getprop ro.build.version.release' [ADB] Current device property 'ro.build.version.release': 5.1.1 [AndroidDriver] Using device: 127.0.0.1:62001 [ADB] Setting device id to 127.0.0.1:62001 [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell getprop ro.build.version.sdk' [ADB] Current device property 'ro.build.version.sdk': 22 [ADB] Device API level: 22 [AndroidDriver] App file was not listed, instead we're going to run com.xingin.xhs directly on the device [AndroidDriver] Checking whether package is present on the device [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell pm list packages com.xingin.xhs' [AndroidDriver] Starting Android session [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 wait-for-device' [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell echo ping' [AndroidDriver] Pushing settings apk to device... [ADB] Getting install status for io.appium.settings [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell dumpsys package io.appium.settings' [ADB] 'io.appium.settings' is not installed [ADB] App 'C:\Users\zlp\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk' is not installed [ADB] Installing 'C:\Users\zlp\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk' [ADB] Skipping permissions grant option, since the current API level 22 does not support applications permissions customization [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 install C\:\\Users\\zlp\\AppData\\Local\\Programs\\Appium\\resources\\app\\node_modules\\appium\\node_modules\\io.appium.settings\\apks\\settings_apk-debug.apk' [ADB] Install command stdout: pkg: /data/local/tmp/settings_apk-debug.apk [ADB] Success [ADB] Getting IDs of all 'io.appium.settings' processes [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell 'pgrep --help; echo $?'' [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell 'pidof --help > /dev/null; echo $?'' [ADB] Using ps-based PID detection [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell ps' [AndroidDriver] Granting android.permission.SET_ANIMATION_SCALE, CHANGE_CONFIGURATION, ACCESS_FINE_LOCATION by pm grant [ADB] Granting permissions ["android.permission.SET_ANIMATION_SCALE","android.permission.CHANGE_CONFIGURATION","android.permission.ACCESS_FINE_LOCATION"] to 'io.appium.settings' [ADB] Got the following command chunks to execute: [["pm","grant","io.appium.settings","android.permission.SET_ANIMATION_SCALE",";","pm","grant","io.appium.settings","android.permission.CHANGE_CONFIGURATION",";","pm","grant","io.appium.settings","android.permission.ACCESS_FINE_LOCATION",";"]] [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell pm grant io.appium.settings android.permission.SET_ANIMATION_SCALE \; pm grant io.appium.settings android.permission.CHANGE_CONFIGURATION \; pm grant io.appium.settings android.permission.ACCESS_FINE_LOCATION \;' [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell am start -W -n io.appium.settings/.Settings -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000' [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell settings put secure mock_location 1' [Logcat] Starting logcat capture [AndroidDriver] Enabling Unicode keyboard support [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell settings get secure default_input_method' [AndroidDriver] Unsetting previous IME com.android.inputservice/.InputService [AndroidDriver] Setting IME to 'io.appium.settings/.UnicodeIME' [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell ime enable io.appium.settings/.UnicodeIME' [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell ime set io.appium.settings/.UnicodeIME' [ADB] Getting device platform version [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell getprop ro.build.version.release' [ADB] Current device property 'ro.build.version.release': 5.1.1 [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell wm size' [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell getprop ro.product.model' [ADB] Current device property 'ro.product.model': MI 6 [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell getprop ro.product.manufacturer' [ADB] Current device property 'ro.product.manufacturer': Xiaomi [AndroidDriver] No app sent in, not parsing package/activity [AndroidDriver] No app capability. Assuming it is already on the device [AndroidBootstrap] Watching for bootstrap disconnect [ADB] Forwarding system: 4724 to device: 4724 [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 forward tcp\:4724 tcp\:4724' [UiAutomator] Starting UiAutomator [UiAutomator] Moving to state 'starting' [UiAutomator] Parsing uiautomator jar [UiAutomator] Found jar name: 'AppiumBootstrap.jar' [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 push C\:\\Users\\zlp\\AppData\\Local\\Programs\\Appium\\resources\\app\\node_modules\\appium\\node_modules\\appium-android-driver\\bootstrap\\bin\\AppiumBootstrap.jar /data/local/tmp/' [ADB] Attempting to kill all uiautomator processes [ADB] Getting IDs of all 'uiautomator' processes [ADB] Using ps-based PID detection [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell ps' [ADB] No 'uiautomator' process has been found [UiAutomator] Starting UIAutomator [ADB] Creating ADB subprocess with args: ["-P",5037,"-s","127.0.0.1:62001","shell","uiautomator","runtest","AppiumBootstrap.jar","-c","io.appium.android.bootstrap.Bootstrap","-e","pkg","com.xingin.xhs","-e","disableAndroidWatchers",false,"-e","acceptSslCerts",false] [UiAutomator] Moving to state 'online' [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Loading json... [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Registered crash watchers. [AndroidBootstrap] Android bootstrap socket is now connected [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell dumpsys window' [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Client connected [AndroidDriver] Screen already unlocked, doing nothing [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell am start -W -n com.xingin.xhs/.activity.SplashActivity -S' [AndroidDriver] Shutting down Android driver [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell am force-stop com.xingin.xhs' [BaseDriver] Event 'newSessionStarted' logged at 1553679571306 (17:39:31 GMT+0800 (中国标准时间)) [W3C] Encountered internal error running command: Error: Cannot start the 'com.xingin.xhs' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Error executing adbExec. Original error: 'Command 'D\:\\android-sdk\\sdk\\adt-bundle-windows-x86_64-20140702\\sdk\\platform-tools\\adb.exe -P 5037 -s 127.0.0.1\:62001 shell am start -W -n com.xingin.xhs/.activity.SplashActivity -S' timed out after 20000ms'. Try to increase the 20000ms adb execution timeout represented by 'adbExecTimeout' capability [W3C] at ADB.apkUtilsMethods.startApp (C:\Users\zlp\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:144:11) [HTTP] <-- POST /wd/hub/session 500 168162 ms - 1794 [HTTP] ```
appium报错:Failed to launch Appium Settings app
我的步骤 1.使用adb devices中查看到我的设备(这里我使用的是雷电模拟器) 2.配置完desired caps后运行代码报错 ``` from appium import webdriver import time desired_caps ={ 'platformName':'Android', 'deviceName':'emulator-5554', 'platformVersion':'5.1', 'appPackage':'com.android.contacts', 'appActivity':'.activities.PeopleActivity', } driver = webdriver.Remote('http://localhost:4723/wd/hub',desired_caps) driver.quit() ``` 报错如下: ``` selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Failed to launch Appium Settings app: Condition unmet after 5384 ms. Timing out. ```
使用cmd启动appium报错,使用appium-desktop启动却不报错
环境: * 电脑:win 7 64位 * python 3.5 * PyCharm Community Edition 2017.1.1 x64 * 模拟器:逍遥模拟器 android 5.1.1 * appium -v 1.14.2 * appium-desktop-Setup-1.5.0-ia32.exe * jdk version "1.8.0_05" * nodejs : 10.16.3 以下是代码: ``` from appium import webdriver desired_caps={} desired_caps['platformName']='Android' desired_caps['platformVersion']='5.1.1' desired_caps['deviceName']='127.0.0.1:21503' desired_caps['app']=r'C:\Users\Administrator\Desktop\kaoyan3.1.0.apk' desired_caps['appActivity']='com.tal.kaoyan.ui.activity.SplashActivity' desired_caps['appPackage']='com.tal.kaoyan' desired_caps['noReset']='False' driver=webdriver.Remote('http://localhost:4723/wd/hub',desired_caps) ``` 以cmd启动 appium -a 127.0.0.1 -p 4723,运行pycharm,启动模拟器上APP,报错的信息: selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Failed to launch Appium Settings app: Condition unmet after 5191 ms. Timing out * 奇怪的是使用appium-desktop-Setup-1.5.0-ia32.exe启动appium,运行pycharm,启动模拟器上APP,却不报错,找不到原因,求大神分析一下!
求助:Appium如何启动Android默认的浏览器
利用测试工具Appium写出代码来启动Android默认的浏览器
appium 启动一个服务和UI的APP,启动时服务总是启动不了
要用robot+appium 测试一个apk,这个apk是由一个服务和UI组成的,我用 aapt dump badging xxxx.apk 获取 launchable-activity 用 uiautomatorviewer.bat工具获取包名,然后用 Open Application 启动 APP 问题是:每次好像只有UI启动了,服务没有启动,为什么呢,跪求大神指教。
python+appium在Android环境下运行 报错WebDriverException
appium初学小菜鸟需要救急 在python+appium在Android环境下运行 报错WebDriverException: Message: Invalid locator strategy: css selector,环境变量检查过了没有问题,希望大家帮我看看是哪里的问题?
appium-desktop启动模拟器adb命令超时失败
1appium-desktop启动模拟器adb命令超时失败 2.使用appium-server启动没有问题 报错如下: ``` [Appium] Welcome to Appium v1.15.0 [Appium] Non-default server args: [Appium] allowInsecure: { [Appium] } [Appium] denyInsecure: { [Appium] } [Appium] Appium REST http interface listener started on 0.0.0.0:4723 [HTTP] --> POST /wd/hub/session [HTTP] {"capabilities":{"firstMatch":[{}],"alwaysMatch":{"platformName":"Android"}},"desiredCapabilities":{"platformName":"Android","platformVersion":"5.1.1","deviceName":"Android Emulator","appPackage":"com.android.calculator2","appActivity":".Calculator"}} [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"Android","platformVersion":"5.1.1","deviceName":"Android Emulator","appPackage":"com.android.calculator2","appActivity":".Calculator"},null,{"firstMatch":[{}],"alwaysMatch":{"platformName":"Android"}}] [BaseDriver] Event 'newSessionRequested' logged at 1571708607532 (09:43:27 GMT+0800 (中国标准时间)) [Appium] Could not parse W3C capabilities: 'deviceName' can't be blank [Appium] Trying to fix W3C capabilities by merging them with JSONWP caps [BaseDriver] The capabilities ["platformVersion","deviceName","appPackage","appActivity"] are not standard capabilities and should have an extension prefix [Appium] [Appium] ====================================================================== [Appium] DEPRECATION WARNING: [Appium] [Appium] The 'automationName' capability was not provided in the desired [Appium] capabilities for this Android session [Appium] [Appium] Setting 'automationName=UiAutomator2' by default and using the [Appium] UiAutomator2 Driver [Appium] [Appium] The next major version of Appium (2.x) will **require** the [Appium] 'automationName' capability to be set for all sessions on all [Appium] platforms [Appium] [Appium] In previous versions (Appium <= 1.13.x), the default was [Appium] 'automationName=UiAutomator1' [Appium] [Appium] If you wish to use that automation instead of UiAutomator2, please [Appium] add 'automationName=UiAutomator1' to your desired capabilities [Appium] [Appium] For more information about drivers, please visit [Appium] http://appium.io/docs/en/about-appium/intro/ and explore the [Appium] 'Drivers' menu [Appium] [Appium] ====================================================================== [Appium] [Appium] Appium v1.15.0 creating new AndroidUiautomator2Driver (v1.37.1) session [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided [BaseDriver] Creating session with W3C capabilities: { [BaseDriver] "alwaysMatch": { [BaseDriver] "platformName": "Android", [BaseDriver] "appium:platformVersion": "5.1.1", [BaseDriver] "appium:deviceName": "Android Emulator", [BaseDriver] "appium:appPackage": "com.android.calculator2", [BaseDriver] "appium:appActivity": ".Calculator" [BaseDriver] }, [BaseDriver] "firstMatch": [ [BaseDriver] {} [BaseDriver] ] [BaseDriver] } [BaseDriver] Session created with session id: 838e3971-499e-42b3-aacd-1ef1a14ff4be [UiAutomator2] Starting 'com.android.calculator2' directly on the device [ADB] Found 1 'build-tools' folders under 'E:\androidsdk\android-sdk-windows' (newest first): [ADB] E:/androidsdk/android-sdk-windows/build-tools/29.0.2 [ADB] Using 'adb.exe' from 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe' [AndroidDriver] Retrieving device list [ADB] Trying to find a connected android device [ADB] Getting connected devices... [ADB] Connected devices: [{"udid":"emulator-5554","state":"device"}] [AndroidDriver] Looking for a device with Android '5.1.1' [ADB] Setting device id to emulator-5554 [ADB] Getting device platform version [ADB] Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.release' [ADB] Current device property 'ro.build.version.release': 5.1.1 [AndroidDriver] Using device: emulator-5554 [ADB] Using 'adb.exe' from 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe' [ADB] Setting device id to emulator-5554 [ADB] Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.sdk' [ADB] Current device property 'ro.build.version.sdk': 22 [ADB] Device API level: 22 [AndroidDriver] No app sent in, not parsing package/activity [ADB] Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 wait-for-device' [ADB] Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell echo ping' [AndroidDriver] Pushing settings apk to device... [ADB] Getting install status for io.appium.settings [ADB] Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings' [ADB] 'io.appium.settings' is installed [ADB] Getting package info for 'io.appium.settings' [ADB] Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings' [ADB] Cannot extract apk info using apkanalyzer. Falling back to aapt. Original error: Could not find 'apkanalyzer.bat' in ["E:\\androidsdk\\android-sdk-windows\\platform-tools\\apkanalyzer.bat","E:\\androidsdk\\android-sdk-windows\\emulator\\apkanalyzer.bat","E:\\androidsdk\\android-sdk-windows\\tools\\apkanalyzer.bat","E:\\androidsdk\\android-sdk-windows\\tools\\bin\\apkanalyzer.bat","E:\\androidsdk\\android-sdk-windows\\build-tools\\29.0.2\\apkanalyzer.bat"]. Do you have Android Build Tools installed at 'E:\androidsdk\android-sdk-windows'? [ADB] Using 'aapt.exe' from 'E:\androidsdk\android-sdk-windows\build-tools\29.0.2\aapt.exe' [ADB] The version name of the installed 'io.appium.settings' is greater or equal to the application version name ('2.14.2' >= '2.14.2') [ADB] There is no need to install/upgrade 'C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk' [ADB] Getting IDs of all 'io.appium.settings' processes [ADB] Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'pgrep --help; echo $?'' [ADB] Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'pidof --help > /dev/null; echo $?'' [ADB] Using ps-based PID detection [ADB] Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell ps' [AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions. [ADB] Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell settings put secure mock_location 1' [Logcat] Starting logcat capture [ADB] Getting install status for io.appium.uiautomator2.server [ADB] Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server' [ADB] 'io.appium.uiautomator2.server' is installed [ADB] Getting package info for 'io.appium.uiautomator2.server' [ADB] Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server' [ADB] Cannot extract apk info using apkanalyzer. Falling back to aapt. Original error: Could not find 'apkanalyzer.bat' in ["E:\\androidsdk\\android-sdk-windows\\platform-tools\\apkanalyzer.bat","E:\\androidsdk\\android-sdk-windows\\emulator\\apkanalyzer.bat","E:\\androidsdk\\android-sdk-windows\\tools\\apkanalyzer.bat","E:\\androidsdk\\android-sdk-windows\\tools\\bin\\apkanalyzer.bat","E:\\androidsdk\\android-sdk-windows\\build-tools\\29.0.2\\apkanalyzer.bat"]. Do you have Android Build Tools installed at 'E:\androidsdk\android-sdk-windows'? [ADB] The version name of the installed 'io.appium.uiautomator2.server' is greater or equal to the application version name ('4.3.0' >= '4.3.0') [UiAutomator2] io.appium.uiautomator2.server installation state: sameVersionInstalled [ADB] Checking app cert for C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.3.0.apk [ADB] Using 'apksigner.bat' from 'E:\androidsdk\android-sdk-windows\build-tools\29.0.2\apksigner.bat' [ADB] Starting 'E:\androidsdk\android-sdk-windows\build-tools\29.0.2\apksigner.bat' with args '["verify","--print-certs","C:\\Users\\Administrator\\AppData\\Local\\Programs\\Appium\\resources\\app\\node_modules\\appium\\node_modules\\appium-uiautomator2-server\\apks\\appium-uiautomator2-server-v4.3.0.apk"]' [ADB] apksigner stdout: Signer #1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US [ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc [ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81 [ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87 [ADB] [ADB] 'C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.3.0.apk' is already signed. [ADB] Getting install status for io.appium.uiautomator2.server.test [ADB] Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server.test' [ADB] 'io.appium.uiautomator2.server.test' is not installed [ADB] Checking app cert for C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk [ADB] Starting 'E:\androidsdk\android-sdk-windows\build-tools\29.0.2\apksigner.bat' with args '["verify","--print-certs","C:\\Users\\Administrator\\AppData\\Local\\Programs\\Appium\\resources\\app\\node_modules\\appium\\node_modules\\appium-uiautomator2-server\\apks\\appium-uiautomator2-server-debug-androidTest.apk"]' [ADB] apksigner stdout: Signer #1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US [ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc [ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81 [ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87 [ADB] [ADB] 'C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk' is already signed. [UiAutomator2] Server packages are going to be (re)installed [ADB] Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'ls -t -1 /data/local/tmp/appium_cache 2>&1 || echo _ERROR_'' [ADB] The current Android API does not support extended ls options. Defaulting to no-options call [ADB] Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'ls /data/local/tmp/appium_cache 2>&1 || echo _ERROR_'' [ADB] The count of applications in the cache: 2 [ADB] The application at 'C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.3.0.apk' is already cached to '/data/local/tmp/appium_cache/0cc1725a60a05dbb5d0d09256f2fc6ece7e3b10f.apk' [ADB] Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm install -r /data/local/tmp/appium_cache/0cc1725a60a05dbb5d0d09256f2fc6ece7e3b10f.apk' [UiAutomator2] Deleting UiAutomator2 session [UiAutomator2] Deleting UiAutomator2 server session [WD Proxy] Matched '/' to command name 'deleteSession' [UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: Trying to proxy a session command without session id [ADB] Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop com.android.calculator2' [Logcat] Stopping logcat capture [ADB] Removing forwarded port socket connection: 8200 [ADB] Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 forward --remove tcp\:8200' [UiAutomator2] Unable to remove port forward 'Error executing adbExec. Original error: 'Command 'E:\\androidsdk\\android-sdk-windows\\platform-tools\\adb.exe -P 5037 -s emulator-5554 forward --remove tcp\:8200' exited with code 1'; Stderr: 'adb.exe: error: listener 'tcp:8200' not found'; Code: '1'' [BaseDriver] Event 'newSessionStarted' logged at 1571708636226 (09:43:56 GMT+0800 (中国标准时间)) [W3C] Encountered internal error running command: Error executing adbExec. Original error: 'Command 'E:\\androidsdk\\android-sdk-windows\\platform-tools\\adb.exe -P 5037 -s emulator-5554 shell pm install -r /data/local/tmp/appium_cache/0cc1725a60a05dbb5d0d09256f2fc6ece7e3b10f.apk' timed out after 20000ms'. Try to increase the 20000ms adb execution timeout represented by 'uiautomator2ServerInstallTimeout' capability [W3C] Error: Command 'E:\\androidsdk\\android-sdk-windows\\platform-tools\\adb.exe -P 5037 -s emulator-5554 shell pm install -r /data/local/tmp/appium_cache/0cc1725a60a05dbb5d0d09256f2fc6ece7e3b10f.apk' timed out after 20000ms [W3C] at Timeout.setTimeout (C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\teen_process\lib\exec.js:125:19) [W3C] at ontimeout (timers.js:427:11) [W3C] at tryOnTimeout (timers.js:289:5) [W3C] at listOnTimeout (timers.js:252:5) [W3C] at Timer.processTimers (timers.js:212:10) [HTTP] <-- POST /wd/hub/session 500 28715 ms - 1450 [HTTP] ```
急急急,appium运行android7.1.1的系统报错
appium运行android7.1.1系统报错,已经根据网上提供的三种方法做了修改,还是不行。具体报错如下: ![图片说明](https://img-ask.csdn.net/upload/201711/28/1511836421_485245.png)
appium怎么通过命令行测试?
如题,比如我现在有要测试的app和测试文件,怎么在命令行调用appium进行测试? 我不知道appium在哪里指定测试文件的,能不通过eclipse,只是用命令测试吗?谢谢
appium:求 Failed to launch Appium Settings app的解决办法
我使用的是雷电模拟器 代码如下![图片说明](https://img-ask.csdn.net/upload/201910/21/1571663543_70364.png) ``` from appium import webdriver import time desired_caps ={ 'platformName':'Android', 'udid':'emulator-5554', 'deviceName':'deviceName', 'platformVersion':'5.1.1', 'appPackage':'com.android.contacts', 'appActivity':'.activities.PeopleActivity', 'unicodeKeyboard':True } driver = webdriver.Remote('http://localhost:4723/wd/hub',desired_caps) driver.quit() ``` 请问如何解决 我搜了很久都没有解决, adb devices中有我模拟器的设备
App自动化报错:Proxy error: Could not proxy command to remote server. Original error: 404 - undefined
    App启动参数如下(存放在Yaml文件中): ``` automationName: UiAutomator2 platformName: Android platformVersion: 7 deviceName: Android Emulator appPackage: com.ellabook appActivity: com.ellabook.startup.StartActivity noReset: False unicodeKeyboard: True # 将键盘给隐藏起来 resetKeyboard: True ```      其他信息:       Appium 1.15       模拟器: 雷电模拟器4.0.7       测试框架: pytest conftest.py内容如下: ``` def basedriver(port=4723, **kwargs): """ 根据设置的参数,启动会话,并返回会话对象 :param port: 会话启动端口号---int :param kwargs: 启动参数 :return: 会话对象 """ yamls = YAML(typ='safe') yaml_path = os.path.join(CAPS_PATH, "desire_caps.yaml") fs = open(yaml_path, encoding='UTF-8') desire_caps = yamls.load(fs) if kwargs: for key, value in kwargs.items(): desire_caps[key] = value driver = webdriver.Remote("http://localhost:{}/wd/hub".format(port), desire_caps) return driver @pytest.fixture(scope="class") def initdriver_first_start(): """App首次启动""" driver = basedriver(noReset=False) yield driver driver.close() ```     测试用例py文件内容: ``` @pytest.mark.usefixtures("initdriver_first_start") class TestAPPStart: """APP启动页测试: 是否进入启动页 、banner图正常滑动、点击"开始看书吧"进入登录界面 """ def test_0_into_start(self, initdriver_first_start): """APP首次启动,启动页是否展示“开始阅读吧”按钮 """ driver = initdriver_first_start AppStartPage(driver).check_read_book_is_exist() def test_banner_left_slip(self, initdriver_first_start): """APP首次启动,启动页广告图能够向左滑""" driver = initdriver_first_start AppStartPage(driver).slide_start_banner("left") # App首次启动,banner广告图正常切换 def test_banner_right_slip(self, initdriver_first_start): """APP首次启动,启动页广告图能够能够向右滑""" driver = initdriver_first_start AppStartPage(driver).slide_start_banner("right") # App首次启动,banner广告图正常切换 def test_click_button(self, initdriver_first_start): """APP首次启动,点击开始按钮,查看是否进入登录界面""" driver = initdriver_first_start AppStartPage(driver).click_start_read() # 点击“开始阅读” 按钮 LoginPage(driver).check_into_login_idle() # 查看是否进入登录界面 ```     APP启动页测试 测试类(pytest/py.test方式)运行,此时用例执行完成后,在进行测试类的teardown时,却报错: selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Could not proxy. Proxy error: Could not proxy command to remote server. Original error: 404 - undefined ![图片说明](https://img-ask.csdn.net/upload/201912/26/1577335992_418416.png)  网上百度了一堆资料,但依旧没有相关: 404 - undefined 的报错类型的解决方法(忧伤)
appium切换到webview后,获取不了真实的html页面,应该怎么处理?
**问题** 我使用appium 测试我公司的混合app,使用driver.context("WebView")切换到webview后,调用getPageSource(),返回如下 ``` <html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><iframe name="chromedriver dummy frame" src="about:blank"></iframe></body></html> ``` **环境:** ``` appium:1.15.1 OS:Windows 10 API :java Android:8.1 ``` **chrome inspect** ![chrome inspect 图片](https://i.stack.imgur.com/X9L6U.png) ![图片说明](https://i.stack.imgur.com/V8Ldq.png) **配置代码** ``` capabilities.setCapability("platformName", "Android"); capabilities.setCapability("deviceName", "b307aa10"); capabilities.setCapability("automationName", "appium"); capabilities.setCapability("platformVersion", "8.1.0"); capabilities.setCapability("appPackage", "com.dayizhihui.dayishi.hpv"); capabilities.setCapability("appActivity", ".main.view.WelcomeActivity"); capabilities.setCapability("noReset", "true"); Map<String, Object> chromeOptions = new HashMap<String, Object>(); chromeOptions.put("androidPackage", "com.android.chrome"); capabilities.setCapability(ChromeOptions.CAPABILITY,chromeOptions); ``` **程序代码** ``` driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); introducePageHandle.clickIntroduceIcon(); System.out.println("Before " + driver.getContext()); System.out.println("All Contexts " + driver.getContextHandles()); driver.context("WEBVIEW_com.dayizhihui.dayishi.hpv"); System.out.println("After " + driver.getContext()); System.out.println("PageSource " + driver.getPageSource()); ``` **输出如下** ``` Before NATIVE_APP All Contexts [NATIVE_APP, WEBVIEW_com.dayizhihui.dayishi.hpv, WEBVIEW_chrome] After WEBVIEW_com.dayizhihui.dayishi.hpv PageSource <html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><iframe name="chromedriver dummy frame" src="about:blank"></iframe></body></html> ```
使用appium进行remove_app或者install_app操作报错
求帮助!我大概能知道是进程的原因,但仍然是百思不得其解!使用appium进行remove_app或者install_app操作报错Message: ERROR running Appium command: Cannot read property 'curDeviceId' of null ``` desired_caps = { 'platformName': 'Android', 'deviceName': 'Z2X4C15723003439', # 'deviceName': 'LE67A06230436549', 'platformVersion': '6', # 'app': packages[0] # apk包名 'appPackage': 'com.cehome.tiebaobei', # apk的launcherActivity 'appActivity': 'com.cehome.tiebaobei.activity.MainEntranceActivity' } driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub',desired_caps) time.sleep(20) driver.close_app() time.sleep(30) driver.remove_app('com.cehome.tiebaobei') ```
appium+python+安卓真机9.0.0启动app时报错
appium+python,安卓机7.1.2时启动app正常,安卓真机9.0.0时,启动app时报错selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Unable to find an active device or emulator with OS 9.0.0. The following are available: FJH5T18830006764 (9)?有朋友遇到过没?如何解决的?
关于appium包名与启动名填写的问题
使用dumpsys命令查询出来的包名与启动名前缀不一致该如何填写到脚本里面 ![图片说明](https://img-ask.csdn.net/upload/201910/12/1570846126_274270.png) 这样填写会报错 ![图片说明](https://img-ask.csdn.net/upload/201910/12/1570846204_415800.png) 求大神解答,感谢
appuim启动魅族手机app报错
报错信息:An unknown server-side error occurred while processing the command. Original error: Failed to launch Appium Settings app: Condition unmet after 5399 ms. Timing out.
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载    点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量 path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、PDF搜索网站推荐 对于大部
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入  假设现有4个人
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
写在前面: 我是 扬帆向海,这个昵称来源于我的名字以及女朋友的名字。我热爱技术、热爱开源、热爱编程。技术是开源的、知识是共享的。 这博客是对自己学习的一点点总结及记录,如果您对 Java、算法 感兴趣,可以关注我的动态,我们一起学习。 用知识改变命运,让我们的家人过上更好的生活。 目录一、杨辉三角的介绍二、杨辉三角的算法思想三、代码实现1.第一种写法2.第二种写法 一、杨辉三角的介绍 百度
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
SQL-小白最佳入门sql查询一
一 说明 如果是初学者,建议去网上寻找安装Mysql的文章安装,以及使用navicat连接数据库,以后的示例基本是使用mysql数据库管理系统; 二 准备前提 需要建立一张学生表,列分别是id,名称,年龄,学生信息;本示例中文章篇幅原因SQL注释略; 建表语句: CREATE TABLE `student` ( `id` int(11) NOT NULL AUTO_INCREMENT, `
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // dosho
【图解经典算法题】如何用一行代码解决约瑟夫环问题
约瑟夫环问题算是很经典的题了,估计大家都听说过,然后我就在一次笔试中遇到了,下面我就用 3 种方法来详细讲解一下这道题,最后一种方法学了之后保证让你可以让你装逼。 问题描述:编号为 1-N 的 N 个士兵围坐在一起形成一个圆圈,从编号为 1 的士兵开始依次报数(1,2,3…这样依次报),数到 m 的 士兵会被杀死出列,之后的士兵再从 1 开始报数。直到最后剩下一士兵,求这个士兵的编号。 1、方
致 Python 初学者
文章目录1. 前言2. 明确学习目标,不急于求成,不好高骛远3. 在开始学习 Python 之前,你需要做一些准备2.1 Python 的各种发行版2.2 安装 Python2.3 选择一款趁手的开发工具3. 习惯使用IDLE,这是学习python最好的方式4. 严格遵从编码规范5. 代码的运行、调试5. 模块管理5.1 同时安装了py2/py35.2 使用Anaconda,或者通过IDE来安装模
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,
程序员:我终于知道post和get的区别
IT界知名的程序员曾说:对于那些月薪三万以下,自称IT工程师的码农们,其实我们从来没有把他们归为我们IT工程师的队伍。他们虽然总是以IT工程师自居,但只是他们一厢情愿罢了。 此话一出,不知激起了多少(码农)程序员的愤怒,却又无可奈何,于是码农问程序员。 码农:你知道get和post请求到底有什么区别? 程序员:你看这篇就知道了。 码农:你月薪三万了? 程序员:嗯。 码农:你是怎么做到的? 程序员:
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
      11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI 算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC
【技巧总结】位运算装逼指南
位算法的效率有多快我就不说,不信你可以去用 10 亿个数据模拟一下,今天给大家讲一讲位运算的一些经典例子。不过,最重要的不是看懂了这些例子就好,而是要在以后多去运用位运算这些技巧,当然,采用位运算,也是可以装逼的,不信,你往下看。我会从最简单的讲起,一道比一道难度递增,不过居然是讲技巧,那么也不会太难,相信你分分钟看懂。 判断奇偶数 判断一个数是基于还是偶数,相信很多人都做过,一般的做法的代码如下
日均350000亿接入量,腾讯TubeMQ性能超过Kafka
整理 | 夕颜出品 | AI科技大本营(ID:rgznai100) 【导读】近日,腾讯开源动作不断,相继开源了分布式消息中间件TubeMQ,基于最主流的 OpenJDK8开发的
8年经验面试官详解 Java 面试秘诀
    作者 | 胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。   Java程序员准备和投递简历的实
面试官如何考察你的思维方式?
1.两种思维方式在求职面试中,经常会考察这种问题:北京有多少量特斯拉汽车? 某胡同口的煎饼摊一年能卖出多少个煎饼? 深圳有多少个产品经理? 一辆公交车里能装下多少个乒乓球? 一
相关热词 c# 输入ip c# 乱码 报表 c#选择结构应用基本算法 c# 收到udp包后回包 c#oracle 头文件 c# 序列化对象 自定义 c# tcp 心跳 c# ice连接服务端 c# md5 解密 c# 文字导航控件
立即提问