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
之后就停住了,请大家帮我看看是什么问题,纠结了好几天了,谢谢大家!

3个回答

手机上的appium setting 还有unlock删除了,再重启appium就OK了

你这个问题解决了吗,楼主

#desired_caps['appPackage'] = 'com.zhengyuan.watch'
#desired_caps['appActivity'] = 'com.zhengyuan.watch.logic.launch.AppStart'

不明白,你这里为什么要注释掉,这个是指定app启动的,我用的是java,这两行是必须声明的,否则appium根本找不到你的app的启动项!

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
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 的问题 ,看了看相关源码,可能现在能力不足 ,还是无计可施 问题贴出来给大家看看,有遇到过类似困扰的 已解决的大牛们 求指点。 ![图片说明](https://img-ask.csdn.net/upload/201711/29/1511945999_275318.jpeg)
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 启动一个服务和UI的APP,启动时服务总是启动不了
要用robot+appium 测试一个apk,这个apk是由一个服务和UI组成的,我用 aapt dump badging xxxx.apk 获取 launchable-activity 用 uiautomatorviewer.bat工具获取包名,然后用 Open Application 启动 APP 问题是:每次好像只有UI启动了,服务没有启动,为什么呢,跪求大神指教。
使用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 iOS java eclipse环境搭建问题请教
Mac机,想用Appiun进行ios app的自动化测试,测试代码用java写,环境搭了三天了,还是不通,跪求大神指导。 我的搭建步骤: 1. 装了jdk1.8.0-60。 2. 装了eclipse。 3. 去appium.io网站下载了appium-1.4.8.dmg,并已安装到Mac上。 4. 下载了Appium的java-client-3.1.0.jar , selenium-server-standalone-2.47.1.jar , selenium-java-2.47.1.jar 等一些libs文件。 5. 在eclipse里创建了java工程,导入了相关jar包,写了测试代码.java,启动了Appium,运行java测试代码(run as junit),报错,无法创建session之类的。另外,Appium里面的Inspector也启动不了,弹出的错误也是could not get list of sessions from Appium Server之类的。 网上查,发现appium ios相关的东西好少,而且大多都是空谈,没有一点实际的东西。三天了,问题还是没解决,求小伙伴们帮帮忙。。仅有的C币全部拿出来了,如果有小伙伴能帮忙可以加我微信wangxiaoye_1988 可以微信酬谢~~
appium测试微信公众号出现Could not find package com.android.chrome on the device的问题
1.新手,想在微信上面测试公众号,用的是appium+java,写了测试用例然后run的时候一直报错,没有找到解决方案,求大神指点,在线等!! 2.以下是我的代码: 初始化init类: ``` package appiumDemo; import java.io.File; import java.net.MalformedURLException; import java.net.URL; import java.util.concurrent.TimeUnit; import org.openqa.selenium.chrome.ChromeOptions; import org.openqa.selenium.remote.CapabilityType; import org.openqa.selenium.remote.DesiredCapabilities; import io.appium.java_client.android.AndroidDriver; public class InitAppium { public static AndroidDriver launchApp(String deviceName) throws MalformedURLException { // 设置自动化相关参数 DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability(CapabilityType.BROWSER_NAME, ""); // 使用哪种移动平台 capabilities.setCapability("platformName", "Android"); // 启动哪种设备,是真机还是模拟器 capabilities.setCapability("deviceName", deviceName); // 如果是模拟器输入Android Emulator 红米note3 db3489d // 不要再次安装apk capabilities.setCapability("noReset", true); // 不用重新签名 capabilities.setCapability("noSign", true); // 设置安卓系统版本 capabilities.setCapability("platformVersion", "7.1"); // 支持unicode键盘,输入中文设置 capabilities.setCapability("unicodeKeyboard", "True"); capabilities.setCapability("resetKeyboard", "True"); // 设置app的主包名和主类名 capabilities.setCapability("appPackage","com.tencent.mm"); capabilities.setCapability("appActivity", "com.tencent.mm.ui.LauncherUI"); ChromeOptions options = new ChromeOptions(); options.setExperimentalOption("androidProcess", "com.tencent.mm:tools"); capabilities.setCapability(ChromeOptions.CAPABILITY, options); AndroidDriver driver = new AndroidDriver(new URL("http://169.254.82.105:4723/wd/hub"), capabilities); driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS); return driver; } } ``` 测试类代码如下: ``` package appiumDemo; import java.net.MalformedURLException; import org.testng.annotations.Test; import io.appium.java_client.android.AndroidDriver; public class NewTest { private AndroidDriver driver; @SuppressWarnings("static-access") @Test public void f() { InitAppium init=new InitAppium(); try { init.launchApp("c353ce90"); } catch (MalformedURLException e) { e.printStackTrace(); } driver.findElementById("com.tencent.mm:id/azj").click(); } } ``` 3.报错信息 ``` [RemoteTestNG] failed to get TestNG version from class: java.lang.ClassNotFoundException: org.testng.internal.Version [RemoteTestNG] now trying to parse the version from pom.properties [RemoteTestNG] parsing TestNG version at jar:file:/E:/test/Tools/maven/maven-repository/org/testng/testng/6.1.1/testng-6.1.1.jar!/META-INF/maven/org.testng/testng/pom.properties [RemoteTestNG] detected TestNG version 6.1.1 [TestNG] Running: C:\Users\vanchu\AppData\Local\Temp\testng-eclipse-1879104749\testng-customsuite.xml FAILED: f org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not find package com.android.chrome on the device (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 9.90 seconds Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:32.194Z' System info: host: 'DESKTOP-GBO4D78', ip: '169.254.151.82', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_91' Driver info: driver.version: AndroidDriver at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166) at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53) at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91) at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:123) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.findFirst(Unknown Source) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142) at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:89) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601) at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219) at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:142) at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:38) at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:87) at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:111) at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:72) at appiumDemo.InitAppium.launchApp(InitAppium.java:54) at appiumDemo.NewTest.f(NewTest.java:16) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80) at org.testng.internal.Invoker.invokeMethod(Invoker.java:673) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:842) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1166) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) at org.testng.TestRunner.runWorkers(TestRunner.java:1178) at org.testng.TestRunner.privateRun(TestRunner.java:757) at org.testng.TestRunner.run(TestRunner.java:608) at org.testng.SuiteRunner.runTest(SuiteRunner.java:334) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291) at org.testng.SuiteRunner.run(SuiteRunner.java:240) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1158) at org.testng.TestNG.runSuitesLocally(TestNG.java:1083) at org.testng.TestNG.run(TestNG.java:999) at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77) =============================================== Default test Tests run: 1, Failures: 1, Skips: 0 =============================================== =============================================== Default suite Total tests run: 1, Failures: 1, Skips: 0 =============================================== [TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@6e6d5e: 1485 ms [TestNG] Time taken by [TestListenerAdapter] Passed:0 Failed:0 Skipped:0]: 296 ms [TestNG] Time taken by org.testng.reporters.XMLReporter@1f256fa: 109 ms [TestNG] Time taken by org.testng.reporters.EmailableReporter@aa5eb0: 62 ms [TestNG] Time taken by org.testng.reporters.JUnitReportReporter@1ebec15: 8 ms ```
初学appium,报服务端的错误
下面这段代码,APP能启动,能打印111,每次在执行 self.driver.find_element_by_android_uiautomator('new UiSelector().className("android.widget.TextView").text("我")').click() 的时候就报错:An unknown server-side error occurred while processing the command,跪求各位大神帮忙解答 class LoginApp(unittest.TestCase): def setUp(self): desired_caps = {} desired_caps['platformName'] = 'Android' desired_caps['platformVersion'] = '4.2.2' desired_caps['deviceName'] = 'Droid4X-WIN' desired_caps['appPackage'] = 'com.junte.onlinefinance' desired_caps['appActivity'] = '.ui.activity.SpalshActivity' self.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub',desired_caps) self.driver.implicitly_wait(5) def login_test(self): print "1111" self.driver.find_element_by_android_uiautomator('new UiSelector().className("android.widget.TextView").text("我")').click() print "222"
AppCrawler在登录之后报错:“ 需要位置路径, 但遇到以下标记: ”这个怎么解,求各路大神解答
这是我的配置文件代码: --- logLevel: "TRACE" saveScreen: true screenshotTimeout: 20 reportTitle: "Mpas" tagLimitMax: 3 tagLimit: - xpath: //*[../*[@selected=‘true‘]] count: 12 currentDriver: "android" maxTime: 10800 resultDir: "" capability: newCommandTimeout: 240 launchTimeout: 120000 platformVersion: "6.0.1" platformName: "Android" autoWebview: "false" autoLaunch: "true" noReset: "false" androidCapability: deviceName: "127.0.0.1:7555" appPackage: "com.tian.mpas.gen" appActivity: "io.dcloud.PandoraEntryActivity" app: "D:/BaiduNetdiskDownload/appcrawler/mpas_0306161529.apk" appium: "http://127.0.0.1:4723/wd/hub" automationName: uiautomator2 reuse: 3 maxDepth: 20 headFirst: true enterWebView: true triggerActions: # 这里可以设置触发器 - action: 106264 xpath: "/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.LinearLayout/android.webkit.WebView/android.webkit.WebView/android.widget.EditText" times: 1 - action: "click" xpath: "/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.LinearLayout/android.webkit.WebView/android.webkit.WebView/android.view.View[3]" times: 1 - action: 704 xpath: "/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.LinearLayout/android.webkit.WebView/android.webkit.WebView/android.widget.EditText[1]" times: 1 - action: 111111 xpath: "/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.LinearLayout/android.webkit.WebView/android.webkit.WebView/android.widget.EditText[2]" times: 1 - action: "click" xpath: "/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.LinearLayout/android.webkit.WebView/android.webkit.WebView/android.view.View[1]" times: 1 autoCrawl: true 这是日志: crawl next 2019-04-02 15:54:06 INFO [Crawler.425.needReturn] urlStack=Stack(com.tian.mpas.gen-PandoraEntryActivity) baseUrl=List() maxDepth=20 2019-04-02 15:54:06 INFO [Crawler.834.crawl] no need to back 2019-04-02 15:54:06 INFO [Crawler.487.getAvailableElement] selected nodes size = 2 2019-04-02 15:54:06 INFO [Crawler.499.getAvailableElement] all - black elements size = 1 2019-04-02 15:54:06 INFO [Crawler.528.getAvailableElement] all - first - last elements size = 1 2019-04-02 15:54:06 INFO [Crawler.590.getAvailableElement] all - backButton size=1 2019-04-02 15:54:06 INFO [Crawler.598.getAvailableElement] all - clicked size=1 2019-04-02 15:54:06 INFO [Crawler.605.getAvailableElement] all - skiped fresh elements size=1 2019-04-02 15:54:06 INFO [Crawler.843.crawl] found com.tian.mpas.gen-PandoraEntryActivity.tag=EditText.1.depth=11.id=login_pwd.text=?????? by first available element 2019-04-02 15:54:06 INFO [Crawler.728.setElementAction] set action to click 2019-04-02 15:54:06 ERROR [Crawler.193.crawl] crawl not finish, return with exception 2019-04-02 15:54:06 ERROR [Crawler.194.crawl] javax.xml.transform.TransformerException: 需要位置路径, 但遇到以下标记: ‘true‘ 2019-04-02 15:54:06 ERROR [Crawler.195.crawl] TransformerException: 需要位置路径, 但遇到以下标记: ‘true‘ 2019-04-02 15:54:06 ERROR [Crawler.196.crawl] javax.xml.transform.TransformerException: 需要位置路径, 但遇到以下标记: ‘true‘ 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] javax.xml.transform.TransformerException: 需要位置路径, 但遇到以下标记: ‘true‘ 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] [wrapped] javax.xml.xpath.XPathExpressionException: javax.xml.transform.TransformerException: 需要位置路径, 但遇到以下标记: ‘true‘ 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.error(XPathParser.java:612) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.LocationPath(XPathParser.java:1603) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.PathExpr(XPathParser.java:1319) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.UnionExpr(XPathParser.java:1238) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.UnaryExpr(XPathParser.java:1144) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.MultiplicativeExpr(XPathParser.java:1065) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.AdditiveExpr(XPathParser.java:1007) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.RelationalExpr(XPathParser.java:932) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.EqualityExpr(XPathParser.java:872) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.EqualityExpr(XPathParser.java:896) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.AndExpr(XPathParser.java:836) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.OrExpr(XPathParser.java:809) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.Expr(XPathParser.java:792) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.PredicateExpr(XPathParser.java:1956) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.Predicate(XPathParser.java:1938) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.Step(XPathParser.java:1728) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.RelativeLocationPath(XPathParser.java:1637) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.LocationPath(XPathParser.java:1599) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.PathExpr(XPathParser.java:1319) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.UnionExpr(XPathParser.java:1238) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.UnaryExpr(XPathParser.java:1144) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.MultiplicativeExpr(XPathParser.java:1065) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.AdditiveExpr(XPathParser.java:1007) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.RelationalExpr(XPathParser.java:932) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.EqualityExpr(XPathParser.java:872) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.AndExpr(XPathParser.java:836) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.OrExpr(XPathParser.java:809) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.Expr(XPathParser.java:792) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.PredicateExpr(XPathParser.java:1956) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.Predicate(XPathParser.java:1938) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.Step(XPathParser.java:1728) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.RelativeLocationPath(XPathParser.java:1628) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.LocationPath(XPathParser.java:1599) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.PathExpr(XPathParser.java:1319) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.UnionExpr(XPathParser.java:1238) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.UnaryExpr(XPathParser.java:1144) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.MultiplicativeExpr(XPathParser.java:1065) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.AdditiveExpr(XPathParser.java:1007) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.RelationalExpr(XPathParser.java:932) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.EqualityExpr(XPathParser.java:872) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.AndExpr(XPathParser.java:836) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.OrExpr(XPathParser.java:809) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.Expr(XPathParser.java:792) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.compiler.XPathParser.initXPath(XPathParser.java:131) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.XPath.<init>(XPath.java:180) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.XPath.<init>(XPath.java:268) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.compile(XPathImpl.java:390) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.testerhome.appcrawler.XPathUtil$.getNodeListFromXML(XPathUtil.scala:167) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.testerhome.appcrawler.XPathUtil$.getNodeListFromXPath(XPathUtil.scala:183) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.testerhome.appcrawler.XPathUtil$.getNodeListByKey(XPathUtil.scala:271) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.testerhome.appcrawler.driver.ReactWebDriver.getNodeListByKey(ReactWebDriver.scala:280) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.testerhome.appcrawler.driver.ReactWebDriver.getNodeListByKey$(ReactWebDriver.scala:279) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.testerhome.appcrawler.driver.AppiumClient.getNodeListByKey(AppiumClient.scala:28) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.testerhome.appcrawler.plugin.TagLimitPlugin.$anonfun$getTimesFromTagLimit$1(TagLimitPlugin.scala:70) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at scala.collection.immutable.List.foreach(List.scala:389) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at scala.collection.generic.TraversableForwarder.foreach(TraversableForwarder.scala:35) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at scala.collection.generic.TraversableForwarder.foreach$(TraversableForwarder.scala:35) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at scala.collection.mutable.ListBuffer.foreach(ListBuffer.scala:44) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.testerhome.appcrawler.plugin.TagLimitPlugin.getTimesFromTagLimit(TagLimitPlugin.scala:69) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.testerhome.appcrawler.plugin.TagLimitPlugin.beforeElementAction(TagLimitPlugin.scala:32) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.testerhome.appcrawler.Crawler.$anonfun$beforeElementAction$2(Crawler.scala:698) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.testerhome.appcrawler.Crawler.$anonfun$beforeElementAction$2$adapted(Crawler.scala:698) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at scala.collection.immutable.List.foreach(List.scala:389) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at scala.collection.generic.TraversableForwarder.foreach(TraversableForwarder.scala:35) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at scala.collection.generic.TraversableForwarder.foreach$(TraversableForwarder.scala:35) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at scala.collection.mutable.ListBuffer.foreach(ListBuffer.scala:44) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.testerhome.appcrawler.Crawler.beforeElementAction(Crawler.scala:698) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.testerhome.appcrawler.Crawler.crawl(Crawler.scala:885) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.testerhome.appcrawler.Crawler.$anonfun$crawl$1(Crawler.scala:187) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at scala.util.Try$.apply(Try.scala:209) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.testerhome.appcrawler.Crawler.crawl(Crawler.scala:187) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.testerhome.appcrawler.Crawler.start(Crawler.scala:170) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.testerhome.appcrawler.AppCrawler$.startCrawl(AppCrawler.scala:322) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.testerhome.appcrawler.AppCrawler$.parseParams(AppCrawler.scala:290) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.testerhome.appcrawler.AppCrawler$.main(AppCrawler.scala:91) 2019-04-02 15:54:06 ERROR [Crawler.197.$anonfun$crawl$2] at com.testerhome.appcrawler.AppCrawler.main(AppCrawler.scala) 2019-04-02 15:54:06 ERROR [Crawler.198.crawl] create new session 2019-04-02 15:54:06 INFO [Crawler.214.restart] execute shell on restart 2019-04-02 15:54:06 INFO [Crawler.217.restart] restart appium 2019-04-02 15:54:06 INFO [Crawler.250.setupAppium] afterPageMax=2 2019-04-02 15:54:06 INFO [Crawler.273.setupAppium] use AppiumClient 2019-04-02 15:54:06 INFO [Crawler.274.setupAppium] Map(newCommandTimeout -> 240, appActivity -> io.dcloud.PandoraEntryActivity, launchTimeout -> 120000, platformVersion -> 6.0.1, platformName -> Android, appium -> http://127.0.0.1:4723/wd/hub, autoWebview -> false, autoLaunch -> true, noReset -> true, dontStopAppOnReset -> true, app -> , appPackage -> com.tian.mpas.gen) 2019-04-02 15:54:06 INFO [AppiumClient.30.initLog] already exist 2019-04-02 15:54:20 INFO [AppiumClient.120.getDeviceInfo] screenWidth=576 screenHeight=1024 2019-04-02 15:54:20 INFO [AppiumClient.112.appium] capture dir = D:\BaiduNetdiskDownload\appcrawler\. 2019-04-02 15:54:20 INFO [Crawler.278.setupAppium] com.testerhome.appcrawler.driver.AppiumClient@52856ff9 2019-04-02 15:54:26 INFO [Crawler.627.refreshPage] refresh page 2019-04-02 15:54:26 INFO [AppiumClient.102.getPageSourceWithRetry] start to get page source from appium 2019-04-02 15:54:26 INFO [AppiumClient.117.$anonfun$getPageSourceWithRetry$1] xml format 2019-04-02 15:54:26 INFO [Crawler.645.parsePageContext] appName = com.tian.mpas.gen 2019-04-02 15:54:26 INFO [Crawler.649.parsePageContext] url=com.tian.mpas.gen-PandoraEntryActivity 2019-04-02 15:54:26 INFO [Crawler.673.parsePageContext] currentContentHash=a31f2ffba02d94c71d02a189aee9a17b lastContentHash=d3437db18a75d12c8082d10510a30390 2019-04-02 15:54:26 INFO [Crawler.675.parsePageContext] ui change 2019-04-02 15:54:26 INFO [Crawler.996.doElementAction] current element = com.tian.mpas.gen-PandoraEntryActivity.tag=restart.id=restart 2019-04-02 15:54:26 INFO [Crawler.997.doElementAction] current index = 7 2019-04-02 15:54:26 INFO [Crawler.998.doElementAction] current action = 2019-04-02 15:54:26 INFO [Crawler.999.doElementAction] current xpath = restart-7 2019-04-02 15:54:26 INFO [Crawler.1000.doElementAction] current url = com.tian.mpas.gen-PandoraEntryActivity 2019-04-02 15:54:26 INFO [Crawler.1001.doElementAction] current tag path = 2019-04-02 15:54:26 INFO [Crawler.1002.doElementAction] current file name = com.tian.mpas.gen-PandoraEntryActivity.tag=restart.id=restart 2019-04-02 15:54:26 INFO [Crawler.1014.doElementAction] just log 2019-04-02 15:54:26 INFO [Crawler.1015.doElementAction] { "url" : "com.tian.mpas.gen-PandoraEntryActivity", "tag" : "restart", "id" : "restart", "name" : "", "text" : "", "instance" : "", "depth" : "", "valid" : "true", "selected" : "false", "xpath" : "restart-7", "ancestor" : "", "x" : 0, "y" : 0, "width" : 0, "height" : 0 } 2019-04-02 15:54:26 INFO [Crawler.1123.doElementAction] use last clicked image replace mark 2019-04-02 15:54:26 INFO [Crawler.1130.doElementAction] sleep 500 for loading 2019-04-02 15:54:27 INFO [Crawler.627.refreshPage] refresh page 2019-04-02 15:54:27 INFO [AppiumClient.102.getPageSourceWithRetry] start to get page source from appium 2019-04-02 15:54:27 INFO [AppiumClient.117.$anonfun$getPageSourceWithRetry$1] xml format 2019-04-02 15:54:27 INFO [Crawler.645.parsePageContext] appName = com.tian.mpas.gen 2019-04-02 15:54:27 INFO [Crawler.649.parsePageContext] url=com.tian.mpas.gen-PandoraEntryActivity 2019-04-02 15:54:27 INFO [Crawler.673.parsePageContext] currentContentHash=a31f2ffba02d94c71d02a189aee9a17b lastContentHash=a31f2ffba02d94c71d02a189aee9a17b 2019-04-02 15:54:27 INFO [Crawler.677.parsePageContext] ui not change 2019-04-02 15:54:27 INFO [Crawler.931.saveDom] save to 20190402155254/7_com.tian.mpas.gen-PandoraEntryActivity.tag=restart.id=restart.dom 2019-04-02 15:54:27 INFO [Crawler.953.saveScreen] start screenshot 2019-04-02 15:54:27 INFO [Crawler.956.$anonfun$saveScreen$2] ui change screenshot again 2019-04-02 15:54:28 INFO [Crawler.977.saveScreen] screenshot success 2019-04-02 15:54:28 INFO [Crawler.772.crawl] crawl next 2019-04-02 15:54:28 INFO [Crawler.425.needReturn] urlStack=Stack(com.tian.mpas.gen-PandoraEntryActivity) baseUrl=List() maxDepth=20 2019-04-02 15:54:28 INFO [Crawler.834.crawl] no need to back 2019-04-02 15:54:28 INFO [Crawler.487.getAvailableElement] selected nodes size = 2 2019-04-02 15:54:28 INFO [Crawler.499.getAvailableElement] all - black elements size = 1 2019-04-02 15:54:28 INFO [Crawler.528.getAvailableElement] all - first - last elements size = 1 2019-04-02 15:54:28 INFO [Crawler.590.getAvailableElement] all - backButton size=1 2019-04-02 15:54:28 INFO [Crawler.598.getAvailableElement] all - clicked size=0 2019-04-02 15:54:28 INFO [Crawler.605.getAvailableElement] all - skiped fresh elements size=0 2019-04-02 15:54:28 INFO [Crawler.851.crawl] com.tian.mpas.gen-PandoraEntryActivity all elements had be clicked 2019-04-02 15:54:28 INFO [Crawler.857.crawl] not match afterUrlFinish 2019-04-02 15:54:28 INFO [Crawler.744.getBackButton] go back 2019-04-02 15:54:28 WARN [Crawler.754.getBackButton] no back button 2019-04-02 15:54:28 INFO [Crawler.728.setElementAction] set action to back 2019-04-02 15:54:28 INFO [Crawler.887.crawl] skip beforeElementAction 2019-04-02 15:54:28 INFO [Crawler.996.doElementAction] current element = com.tian.mpas.gen-PandoraEntryActivity.tag=Back.id=Back 2019-04-02 15:54:28 INFO [Crawler.997.doElementAction] current index = 8 2019-04-02 15:54:28 INFO [Crawler.998.doElementAction] current action = back 2019-04-02 15:54:28 INFO [Crawler.999.doElementAction] current xpath = Back-8 2019-04-02 15:54:28 INFO [Crawler.1000.doElementAction] current url = com.tian.mpas.gen-PandoraEntryActivity 2019-04-02 15:54:28 INFO [Crawler.1001.doElementAction] current tag path = 2019-04-02 15:54:28 INFO [Crawler.1002.doElementAction] current file name = com.tian.mpas.gen-PandoraEntryActivity.tag=Back.id=Back 2019-04-02 15:54:28 INFO [Crawler.1018.doElementAction] back 2019-04-02 15:54:28 WARN [Crawler.1150.back] two back action too close 2019-04-02 15:54:30 INFO [Crawler.1154.$anonfun$back$2] navigate back 2019-04-02 15:54:32 INFO [Crawler.1123.doElementAction] use last clicked image replace mark 2019-04-02 15:54:32 INFO [Crawler.1130.doElementAction] sleep 500 for loading 2019-04-02 15:54:33 INFO [Crawler.627.refreshPage] refresh page 2019-04-02 15:54:33 INFO [AppiumClient.102.getPageSourceWithRetry] start to get page source from appium 2019-04-02 15:54:33 INFO [AppiumClient.117.$anonfun$getPageSourceWithRetry$1] xml format 2019-04-02 15:54:33 INFO [Crawler.645.parsePageContext] appName = com.tian.mpas.gen 2019-04-02 15:54:33 INFO [Crawler.649.parsePageContext] url=com.tian.mpas.gen-PandoraEntryActivity 2019-04-02 15:54:33 INFO [Crawler.673.parsePageContext] currentContentHash=a31f2ffba02d94c71d02a189aee9a17b lastContentHash=a31f2ffba02d94c71d02a189aee9a17b 2019-04-02 15:54:33 INFO [Crawler.677.parsePageContext] ui not change 2019-04-02 15:54:33 INFO [Crawler.931.saveDom] save to 20190402155254/8_com.tian.mpas.gen-PandoraEntryActivity.tag=Back.id=Back.dom 2019-04-02 15:54:33 INFO [Crawler.953.saveScreen] start screenshot 2019-04-02 15:54:33 INFO [Crawler.956.$anonfun$saveScreen$2] ui change screenshot again 2019-04-02 15:54:34 INFO [Crawler.977.saveScreen] screenshot success 2019-04-02 15:54:34 INFO [Crawler.709.afterElementAction] backRetry=1 2019-04-02 15:54:34 INFO [Crawler.712.afterElementAction] afterElementAction eval 2019-04-02 15:54:34 INFO [ReportPlugin.36.afterElementAction] clickedElementsList size = 9 2019-04-02 15:54:34 INFO [Crawler.772.crawl]
动态规划入门到熟悉,看不懂来打我啊
持续更新。。。。。。 2.1斐波那契系列问题 2.2矩阵系列问题 2.3跳跃系列问题 3.1 01背包 3.2 完全背包 3.3多重背包 3.4 一些变形选讲 2.1斐波那契系列问题 在数学上,斐波纳契数列以如下被以递归的方法定义:F(0)=0,F(1)=1, F(n)=F(n-1)+F(n-2)(n&gt;=2,n∈N*)根据定义,前十项为1, 1, 2, 3...
130 个相见恨晚的超实用网站,一次性分享出来
相见恨晚的超实用网站 持续更新中。。。
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它是一个过程,是一个不断累积、不断沉淀、不断总结、善于传达自己的个人见解以及乐于分享的过程。
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
Python——画一棵漂亮的樱花树(不同种樱花+玫瑰+圣诞树喔)
最近翻到一篇知乎,上面有不少用Python(大多是turtle库)绘制的树图,感觉很漂亮,我整理了一下,挑了一些我觉得不错的代码分享给大家(这些我都测试过,确实可以生成) one 樱花树 动态生成樱花 效果图(这个是动态的): 实现代码 import turtle as T import random import time # 画樱花的躯干(60,t) def Tree(branch, ...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看...
我在支付宝花了1分钟,查到了女朋友的开房记录!
在大数据时代下,不管你做什么都会留下蛛丝马迹,只要学会把各种软件运用到极致,捉奸简直轻而易举。今天就来给大家分享一下,什么叫大数据抓出轨。据史料证明,马爸爸年轻时曾被...
shell脚本:备份数据库、代码上线
备份MySQL数据库 场景: 一台MySQL服务器,跑着5个数据库,在没有做主从的情况下,需要对这5个库进行备份 需求: 1)每天备份一次,需要备份所有的库 2)把备份数据存放到/data/backup/下 3)备份文件名称格式示例:dbname-2019-11-23.sql 4)需要对1天以前的所有sql文件压缩,格式为gzip 5)本地数据保留1周 6)需要把备份的数据同步到远程备份中心,假如...
聊聊C语言和指针的本质
坐着绿皮车上海到杭州,24块钱,很宽敞,在火车上非正式地聊几句。 很多编程语言都以 “没有指针” 作为自己的优势来宣传,然而,对于C语言,指针却是与生俱来的。 那么,什么是指针,为什么大家都想避开指针。 很简单, 指针就是地址,当一个地址作为一个变量存在时,它就被叫做指针,该变量的类型,自然就是指针类型。 指针的作用就是,给出一个指针,取出该指针指向地址处的值。为了理解本质,我们从计算机模型说起...
为什么你学不过动态规划?告别动态规划,谈谈我的经验
动态规划难吗?说实话,我觉得很难,特别是对于初学者来说,我当时入门动态规划的时候,是看 0-1 背包问题,当时真的是一脸懵逼。后来,我遇到动态规划的题,看的懂答案,但就是自己不会做,不知道怎么下手。就像做递归的题,看的懂答案,但下不了手,关于递归的,我之前也写过一篇套路的文章,如果对递归不大懂的,强烈建议看一看:为什么你学不会递归,告别递归,谈谈我的经验 对于动态规划,春招秋招时好多题都会用到动态...
程序员一般通过什么途径接私活?
二哥,你好,我想知道一般程序猿都如何接私活,我也想接,能告诉我一些方法吗? 上面是一个读者“烦不烦”问我的一个问题。其实不止是“烦不烦”,还有很多读者问过我类似这样的问题。 我接的私活不算多,挣到的钱也没有多少,加起来不到 20W。说实话,这个数目说出来我是有点心虚的,毕竟太少了,大家轻喷。但我想,恰好配得上“一般程序员”这个称号啊。毕竟苍蝇再小也是肉,我也算是有经验的人了。 唾弃接私活、做外...
字节跳动面试官这样问消息队列:分布式事务、重复消费、顺序消费,我整理了一下
你知道的越多,你不知道的越多 点赞再看,养成习惯 GitHub上已经开源 https://github.com/JavaFamily 有一线大厂面试点脑图、个人联系方式和人才交流群,欢迎Star和完善 前言 消息队列在互联网技术存储方面使用如此广泛,几乎所有的后端技术面试官都要在消息队列的使用和原理方面对小伙伴们进行360°的刁难。 作为一个在互联网公司面一次拿一次Offer的面霸...
2020年大前端发展趋势
迅速发展的前端开发,在每⼀年,都为开发者带来了新的关键词。2019 年已步⼊尾声,2020 年前端发展的关键词⼜将有哪些呢?发展的方向又会是什么呢?参考2019年大前端的发展,不出意外,前端依旧会围绕⼩程序、超级APP、跨端开发、前端⼯程化以及新技术运用等几个方面进行展开(可以参考2019年大前端技术趋势深度解读)。 小程序 在⼩程序⽅⾯,今年仍然是⼩程序突⻜猛进的⼀年,各⼤主流的 App 都上线...
如何安装 IntelliJ IDEA 最新版本——详细教程
IntelliJ IDEA 简称 IDEA,被业界公认为最好的 Java 集成开发工具,尤其在智能代码助手、代码自动提示、代码重构、代码版本管理(Git、SVN、Maven)、单元测试、代码分析等方面有着亮眼的发挥。IDEA 产于捷克,开发人员以严谨著称的东欧程序员为主。IDEA 分为社区版和付费版两个版本。 我呢,一直是 Eclipse 的忠实粉丝,差不多十年的老用户了。很早就接触到了 IDEA...
1个月时间整理了2019年上千道Java面试题,近500页文档!
Spring 面试题 1、一般问题 1.1、不同版本的 spring Framework 有哪些主要功能? 1.2、什么是 spring Framework? 1.3、列举 spring Framework 的优点。 1.4、spring Framework 有哪些不同的功能? 1.5、spring Framework 中有多少个模块,它们分别是什么? 1.6、什么是 spring ...
面试还搞不懂redis,快看看这40道面试题(含答案和思维导图)
Redis 面试题 1、什么是 Redis?. 2、Redis 的数据类型? 3、使用 Redis 有哪些好处? 4、Redis 相比 Memcached 有哪些优势? 5、Memcache 与 Redis 的区别都有哪些? 6、Redis 是单进程单线程的? 7、一个字符串类型的值能存储最大容量是多少? 8、Redis 的持久化机制是什么?各自的优缺点? 9、Redis 常见性...
为什么要推荐大家学习字节码?
配套视频: 为什么推荐大家学习Java字节码 https://www.bilibili.com/video/av77600176/ 一、背景 本文主要探讨:为什么要学习 JVM 字节码? 可能很多人会觉得没必要,因为平时开发用不到,而且不学这个也没耽误学习。 但是这里分享一点感悟,即人总是根据自己已经掌握的知识和技能来解决问题的。 这里有个悖论,有时候你觉得有些技术没用恰恰是...
在阿里,40岁的奋斗姿势
在阿里,40岁的奋斗姿势 在阿里,什么样的年纪可以称为老呢?35岁? 在云网络,有这样一群人,他们的平均年龄接近40,却刚刚开辟职业生涯的第二战场。 他们的奋斗姿势是什么样的呢? 洛神赋 “翩若惊鸿,婉若游龙。荣曜秋菊,华茂春松。髣髴兮若轻云之蔽月,飘飖兮若流风之回雪。远而望之,皎若太阳升朝霞;迫而察之,灼若芙蕖出渌波。” 爱洛神,爱阿里云 2018年,阿里云网络产品部门启动洛神2.0升...
【超详细分析】关于三次握手与四次挥手面试官想考我们什么?
在面试中,三次握手和四次挥手可以说是问的最频繁的一个知识点了,我相信大家也都看过很多关于三次握手与四次挥手的文章,今天的这篇文章,重点是围绕着面试,我们应该掌握哪些比较重要的点,哪些是比较被面试官给问到的,我觉得如果你能把我下面列举的一些点都记住、理解,我想就差不多了。 三次握手 当面试官问你为什么需要有三次握手、三次握手的作用、讲讲三次三次握手的时候,我想很多人会这样回答: 首先很多人会先讲下握...
压测学习总结(1)——高并发性能指标:QPS、TPS、RT、吞吐量详解
一、QPS,每秒查询 QPS:Queries Per Second意思是“每秒查询率”,是一台服务器每秒能够相应的查询次数,是对一个特定的查询服务器在规定时间内所处理流量多少的衡量标准。互联网中,作为域名系统服务器的机器的性能经常用每秒查询率来衡量。 二、TPS,每秒事务 TPS:是TransactionsPerSecond的缩写,也就是事务数/秒。它是软件测试结果的测量单位。一个事务是指一...
新程序员七宗罪
当我发表这篇文章《为什么每个工程师都应该开始考虑开发中的分析和编程技能呢?》时,我从未想到它会对读者产生如此积极的影响。那些想要开始探索编程和数据科学领域的人向我寻求建议;还有一些人问我下一篇文章的发布日期;还有许多人询问如何顺利过渡到这个职业。我非常鼓励大家继续分享我在这个旅程的经验,学习,成功和失败,以帮助尽可能多的人过渡到一个充满无数好处和机会的职业生涯。亲爱的读者,谢谢你。 -罗伯特。 ...
活到老,学到老,程序员也该如此
全文共2763字,预计学习时长8分钟 图片来源:Pixabay 此前,“网传阿里巴巴要求尽快实现P8全员35周岁以内”的消息闹得沸沸扬扬。虽然很快被阿里辟谣,但苍蝇不叮无缝的蛋,无蜜不招彩蝶蜂。消息从何而来?真相究竟怎样?我们无从而知。我们只知道一个事实:不知从何时开始,程序猿也被划在了“吃青春饭”行业之列。 饱受“996ICU”摧残后,好不容易“头秃了变强了”,即将步入为“高...
Vue快速实现通用表单验证
本文开篇第一句话,想引用鲁迅先生《祝福》里的一句话,那便是:“我真傻,真的,我单单知道后端整天都是CRUD,我没想到前端整天都是Form表单”。这句话要从哪里说起呢?大概要从最近半个月的“全栈工程师”说起。项目上需要做一个城市配载的功能,顾名思义,就是通过框选和拖拽的方式在地图上完成配载。博主选择了前后端分离的方式,在这个过程中发现:首先,只要有依赖jQuery的组件,譬如Kendoui,即使使用...
2019年Spring Boot面试都问了什么?快看看这22道面试题!
Spring Boot 面试题 1、什么是 Spring Boot? 2、Spring Boot 有哪些优点? 3、什么是 JavaConfig? 4、如何重新加载 Spring Boot 上的更改,而无需重新启动服务器? 5、Spring Boot 中的监视器是什么? 6、如何在 Spring Boot 中禁用 Actuator 端点安全性? 7、如何在自定义端口上运行 Sprin...
Unity项目在pc和ios设备上黑屏的原因探究
0x00 由于项目上线了windows平台的项目(别问我为什么,咱也不敢说,咱也不敢问),由Unity5.4.6升级到Unity2018的过程中,遇到了各种各样的坑,本文为避坑指南1。本项目没有使用HDR和抗锯齿,由于查这几个问题查到吐血,前后用了3天的时间,本文充满了怨气,行文非常啰嗦,需要快速解决问题的,可以直接拉到最后看结论。 0x01 法线贴图 项目在unity2018出了新的androi...
关于裁员几点看法及建议
最近网易裁员事件引起广泛关注,昨天网易针对此事,也发了声明,到底谁对谁错,孰是孰非?我们作为吃瓜观众实在是知之甚少,所以不敢妄下定论。身处软件开发这个行业,近一两年来,对...
面试官:关于Java性能优化,你有什么技巧
通过使用一些辅助性工具来找到程序中的瓶颈,然后就可以对瓶颈部分的代码进行优化。 一般有两种方案:即优化代码或更改设计方法。我们一般会选择后者,因为不去调用以下代码要比调用一些优化的代码更能提高程序的性能。而一个设计良好的程序能够精简代码,从而提高性能。 下面将提供一些在JAVA程序的设计和编码中,为了能够提高JAVA程序的性能,而经常采用的一些方法和技巧。 1.对象的生成和大小的调整。 J...
【图解算法面试】记一次面试:说说游戏中的敏感词过滤是如何实现的?
版权声明:本文为苦逼的码农原创。未经同意禁止任何形式转载,特别是那些复制粘贴到别的平台的,否则,必定追究。欢迎大家多多转发,谢谢。 小秋今天去面试了,面试官问了一个与敏感词过滤算法相关的问题,然而小秋对敏感词过滤算法一点也没听说过。于是,有了下下事情的发生… 面试官开怼 面试官:玩过王者荣耀吧?了解过敏感词过滤吗?,例如在游戏里,如果我们发送“你在干嘛?麻痹演员啊你?”,由于“麻痹”是一个敏感词,...
GitHub 标星 1.6w+,我发现了一个宝藏项目,作为编程新手有福了!
大家好,我是 Rocky0429,一个最近老在 GitHub 上闲逛的蒟蒻… 特别惭愧的是,虽然我很早就知道 GitHub,但是学会逛 GitHub 的时间特别晚。当时一方面是因为菜,看着这种全是英文的东西难受,不知道该怎么去玩,另一方面是一直在搞 ACM,没有做一些工程类的项目,所以想当然的以为和 GitHub 也没什么关系(当然这种想法是错误的)。 后来自己花了一个星期看完了 Pyt...
计算机专业的书普遍都这么贵,你们都是怎么获取资源的?
介绍几个可以下载编程电子书籍的网站。 1.Github Github上编程书资源很多,你可以根据类型和语言去搜索。推荐几个热门的: free-programming-books-zh_CN:58K 星的GitHub,编程语言、WEB、函数、大数据、操作系统、在线课程、数据库相关书籍应有尽有,共有几百本。 Go语言高级编程:涵盖CGO,Go汇编语言,RPC实现,Protobuf插件实现,Web框架实...
毕业5年,我问遍了身边的大佬,总结了他们的学习方法
我问了身边10个大佬,总结了他们的学习方法,原来成功都是有迹可循的。
推荐10个堪称神器的学习网站
每天都会收到很多读者的私信,问我:“二哥,有什么推荐的学习网站吗?最近很浮躁,手头的一些网站都看烦了,想看看二哥这里有什么新鲜货。” 今天一早做了个恶梦,梦到被老板辞退了。虽然说在我们公司,只有我辞退老板的份,没有老板辞退我这一说,但是还是被吓得 4 点多都起来了。(主要是因为我掌握着公司所有的核心源码,哈哈哈) 既然 4 点多起来,就得好好利用起来。于是我就挑选了 10 个堪称神器的学习网站,推...
这些软件太强了,Windows必装!尤其程序员!
Windows可谓是大多数人的生产力工具,集娱乐办公于一体,虽然在程序员这个群体中都说苹果是信仰,但是大部分不都是从Windows过来的,而且现在依然有很多的程序员用Windows。 所以,今天我就把我私藏的Windows必装的软件分享给大家,如果有一个你没有用过甚至没有听过,那你就赚了????,这可都是提升你幸福感的高效率生产力工具哦! 走起!???? NO、1 ScreenToGif 屏幕,摄像头和白板...
MacBook Pro 入手一年了,到底香不香?
最近又有小伙伴问到底值不值得入手一台 MacBook Pro,松哥自己在 2018 年 10 月份的时候入手了一台,到现在为止,也用了一年多了,今天就来和小伙伴们聊一聊使用感受,至于到底值不值,需要大家自行判断。 我的第一台笔记本是大一第二学期(2012 年 4 月份)入手的,是一台 Sony 的 VAIO,这台电脑现在也一直在用,给大家录制的视频教程都是用这台电脑录制了,在接近 8 年的时间里,...
大学四年因为知道了这32个网站,我成了别人眼中的大神!
依稀记得,毕业那天,我们导员发给我毕业证的时候对我说“你可是咱们系的风云人物啊”,哎呀,别提当时多开心啦????,嗯,我们导员是所有导员中最帅的一个,真的???? 不过,导员说的是实话,很多人都叫我大神的,为啥,因为我知道这32个网站啊,你说强不强????,这次是绝对的干货,看好啦,走起来! PS:每个网站都是学计算机混互联网必须知道的,真的牛杯,我就不过多介绍了,大家自行探索,觉得没用的,尽管留言吐槽吧???? 社...
【程序人生】程序员接私活常用平台汇总
00. 目录 文章目录00. 目录01. 前言02. 程序员客栈03. 码市04. 猪八戒网05. 开源众包06. 智城外包网07. 实现网08. 猿急送09. 人人开发10. 开发邦11. 电鸭社区12. 快码13. 英选14. Upwork15. Freelancer16. Dribbble17. Remoteok18. Toptal19. AngelList20. Topcoder21. ...
关于终身成长的几点感想
上周,为了凑单把加入购物车很久的《终身成长:重新定义成功的思维模式》也一起买了。 起初我以为只是单纯的心灵鸡汤类的书,后来看介绍说是“影响美国一代人的心理励志之作,被无数次引用的成功学观点。美国亚马逊心理畅销书在榜10年,《 时代周刊》《早安美国》《华尔街日报》热赞,比尔·盖茨撰文推荐。” 简单来讲,全书主要是讲了两种思维方式:固定型思维模式者和成长型思维模式。有理论,有案例,有方法。书中的关...
Fiddler+夜神模拟器进行APP抓包
Fiddler+夜神模拟器进行APP抓包 作者:霞落满天 需求:对公司APP进行抓包获取详细的接口信息,这是现在开发必备的。 工具:Fiddler抓包,夜神模拟器 模拟手机 安装APP 1.下载Fiddler https://www.telerik.com/download/fiddler Fiddler正是在这里帮助您记录计算机和Internet之间传递的所有HTTP和HTTPS通信...
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆每天早上8:30推送 作者|Mr.K 编辑| Emma 来源|技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯...
相关热词 c#判断数字不得为负数 c#帧和帧协议 c#算偏移值 c# 在枚举中 c#6 字符串 插值 c#程序中的占位符标签 c#监听数组变化 c# vlc c#索引实现 c# 局域网广播通信
立即提问