-
Notifications
You must be signed in to change notification settings - Fork 420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
android apk测试,driver.source() 返回错误的页面结构 #871
Comments
@hailstone 有rom定制的手机暂时没办法 |
This is the translated issue comment: @xudafeng @hailstone has rom custom mobile phone temporarily no way |
@xudafeng 我这边也遇到了这个问题,我这边之前macaca-android 2.0.36,一直是没问题的。今天升级到2.0.48遇到了这个问题。 |
This is the translated issue comment: @ztwo @xudafeng I have encountered this problem here. I have been uiautomatorwd 1.0.41 before, and it has been no problem. Today I upgraded to 1.0.61 and encountered this problem. |
@xudafeng 而且我们这边不是用的魔改rom的系统,是nexus5,原生系统,7.1.2.。也有此问题 |
@ztwo 参考这个办法,看下原数据 |
This is the translated issue comment: @xudafeng @ztwo Reference to this method, look at the original data Https://github.com/alibaba/macaca/issues/883#issuecomment-457832199 |
@xudafeng 感谢回复,app-inspector抓出来的源数据看过,没看出问题,不过使用过程中也有部分手机有偏移的情况(坚果pro2 android7系统)。现在我这边遇到的严重问题是macaca-android,source数据不完整,请问这个可以看到源数据么?或者获取source是那个服务获取的?我加一些日志排查下 |
This is the translated issue comment: @ztwo @xudafeng Thanks for the reply, the source data captured by the app-inspector has been seen, and I have not seen the problem, but some mobile phones have offsets during the use process (nut pro2 android7 system). Now the serious problem I encountered here is macaca-android, the source data is incomplete, can I see the source data? Or get the source that is obtained by that service? I add some logs to check |
@xudafeng 分别加了日志,proxy.js 获取的source数据是完整的,到source.js中输出的source数据是残缺的,最终python client打印出的数据也是残缺的,由此可推断,应该是macaca-cli ? 处理数据时发生了异常,丢失了一部分source信息。对js不熟悉,没找到是那块代码处理,还是得麻烦你这边帮忙排查下 |
This is the translated issue comment: @ztwo @xudafeng Logs are added separately. The source data obtained by proxy.js is complete. The source data output to source.js is incomplete. The data printed by the python client is also incomplete. It can be inferred that it should be macaca-cli. ? An exception occurred while processing the data, and some of the source information was lost. Unfamiliar with js, I haven't found the code to handle it, or I have to trouble you here. |
我找到了解决方法。问题源于macaca-android此次更新:macacajs/macaca-android@17b5c37#diff-6b49b62ca6c8a7110bdda9c1189098ae filter过滤了package 不等于com.android.systemui的节点,但当前应用父节点 package却是com.android.systemui,所以导致这行代码生效。目前我把这行代码注释,返回hierarchy,反馈的问题消失。 |
This is the translated issue comment: @ztwo I found a solution. The problem stems from macaca-android update: macacajs/macaca-android@17b5c37#diff-6b49b62ca6c8a7110bdda9c1189098ae Filter filters the node whose package is not equal to com.android.systemui, but the current application parent package is com.android.systemui, so this line of code takes effect. At the moment I am annotating this line of code and returning to the hierarchy, the feedback problem disappears. |
Macaca Version:
2.1.9
Macaca Doctor Logs:
macaca-doctor version: 2.0.15
Node.js checklist:
node env: /usr/local/bin/node
node version: v8.12.0
iOS checklist:
Xcode Command Line Tools is ready, version: 2347.
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
{ Error: Command failed: xcodebuild -version
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
at checkExecSyncError (child_process.js:602:13)
at Object.execSync (child_process.js:642:13)
at Object.exports.getXcodeVersion (/usr/local/lib/node_modules/macaca-cli/node_modules/macaca-doctor/lib/ios.js:39:38)
at Object.exports.xcodeBuild (/usr/local/lib/node_modules/macaca-cli/node_modules/macaca-doctor/lib/ios.js:51:30)
at exports.xcodeBuild.next ()
at onFulfilled (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:65:19)
at
error: null,
cmd: 'xcodebuild -version',
file: '/bin/sh',
args: [ '/bin/sh', '-c', 'xcodebuild -version' ],
options:
{ shell: true,
file: '/bin/sh',
args: [ '/bin/sh', '-c', 'xcodebuild -version' ],
envPairs:
[ 'UBUNTU_HOME=u6f3eb58cc3ae57',
'VIRTUALENVWRAPPER_SCRIPT=/Users/lihaokai/Library/Python/2.7/bin/virtualenvwrapper.sh',
'VIRTUALENVWRAPPER_PROJECT_FILENAME=.project',
'TERM_PROGRAM=Apple_Terminal',
'ANDROID_HOME=/Users/lihaokai/Library/Android/sdk',
'SHELL=/bin/bash',
'TERM=xterm-256color',
'HISTSIZE=10000',
'TMPDIR=/var/folders/34/b_mf7hrj1zxfd6n5ttnry50mcjd_jr/T/',
'GRADLE_HOME=/Applications/gradle-2.14.1',
'Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.Z71LZa8IuS/Render',
'TERM_PROGRAM_VERSION=388.1.3',
'UBUNTU_VM=172.24.170.115',
'TERM_SESSION_ID=DC007DFE-DDF4-42C6-9D80-C3846AE44064',
'USER=lihaokai',
'SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.rMb6xIxbQI/Listeners',
'__CF_USER_TEXT_ENCODING=0x1916AA38:0x0:0x0',
'JAVA_OPTIONS=-Xmx8G',
'WORKON_HOME=/Users/lihaokai/Envs',
'PATH=/apollo/env/SDETools/bin:/apollo/env/SDETools/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications:/opt/X11/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin:/Applications/gradle-2.14.1/bin:/Users/lihaokai/Library/Android/sdk/platform-tools:/Users/lihaokai/Library/Android/sdk/tools:/Users/lihaokai/Library/Android/sdk/tools/bin:/usr/bin:/Users/lihaokai/code/usefulScripts:/Users/lihaokai/bin:/Users/lihaokai/Library/Android/sdk/build-tools/24.0.1:/usr/local/Cellar/python/3.6.5/bin/python3.6:/Users/lihaokai/.toolbox/bin:/Users/lihaokai/Library/Python/2.7/bin',
'VIRTUALENVWRAPPER_HOOK_DIR=/Users/lihaokai/Envs',
'PWD=/Users/lihaokai',
'JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home',
'LANG=en_US.UTF-8',
'XPC_FLAGS=0x0',
'JUNIT_HOME=/Applications/junit',
'XPC_SERVICE_NAME=0',
'SHLVL=1',
'HOME=/Users/lihaokai',
'GRADLE_OPTS=-Dorg.gradle.jvmargs=-Xmx8G',
'LOGNAME=lihaokai',
'CLASSPATH=:/Applications/junit/junit-4.10.jar:.',
'BRAZIL_CLI_BIN=/apollo/env/SDETools/bin',
'VIRTUALENVWRAPPER_WORKON_CD=1',
'DISPLAY=/private/tmp/com.apple.launchd.l5D2fBdDbT/org.macosforge.xquartz:0',
'SECURITYSESSIONID=1873e',
'=/usr/local/bin/macaca' ],
killSignal: undefined,
stdio: [ [Object], [Object], [Object] ] },
envPairs:
[ 'UBUNTU_HOME=u6f3eb58cc3ae57',
'VIRTUALENVWRAPPER_SCRIPT=/Users/lihaokai/Library/Python/2.7/bin/virtualenvwrapper.sh',
'VIRTUALENVWRAPPER_PROJECT_FILENAME=.project',
'TERM_PROGRAM=Apple_Terminal',
'ANDROID_HOME=/Users/lihaokai/Library/Android/sdk',
'SHELL=/bin/bash',
'TERM=xterm-256color',
'HISTSIZE=10000',
'TMPDIR=/var/folders/34/b_mf7hrj1zxfd6n5ttnry50mcjd_jr/T/',
'GRADLE_HOME=/Applications/gradle-2.14.1',
'Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.Z71LZa8IuS/Render',
'TERM_PROGRAM_VERSION=388.1.3',
'UBUNTU_VM=172.24.170.115',
'TERM_SESSION_ID=DC007DFE-DDF4-42C6-9D80-C3846AE44064',
'USER=lihaokai',
'SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.rMb6xIxbQI/Listeners',
'__CF_USER_TEXT_ENCODING=0x1916AA38:0x0:0x0',
'JAVA_OPTIONS=-Xmx8G',
'WORKON_HOME=/Users/lihaokai/Envs',
'PATH=/apollo/env/SDETools/bin:/apollo/env/SDETools/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications:/opt/X11/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin:/Applications/gradle-2.14.1/bin:/Users/lihaokai/Library/Android/sdk/platform-tools:/Users/lihaokai/Library/Android/sdk/tools:/Users/lihaokai/Library/Android/sdk/tools/bin:/usr/bin:/Users/lihaokai/code/usefulScripts:/Users/lihaokai/bin:/Users/lihaokai/Library/Android/sdk/build-tools/24.0.1:/usr/local/Cellar/python/3.6.5/bin/python3.6:/Users/lihaokai/.toolbox/bin:/Users/lihaokai/Library/Python/2.7/bin',
'VIRTUALENVWRAPPER_HOOK_DIR=/Users/lihaokai/Envs',
'PWD=/Users/lihaokai',
'JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home',
'LANG=en_US.UTF-8',
'XPC_FLAGS=0x0',
'JUNIT_HOME=/Applications/junit',
'XPC_SERVICE_NAME=0',
'SHLVL=1',
'HOME=/Users/lihaokai',
'GRADLE_OPTS=-Dorg.gradle.jvmargs=-Xmx8G',
'LOGNAME=lihaokai',
'CLASSPATH=:/Applications/junit/junit-4.10.jar:.',
'BRAZIL_CLI_BIN=/apollo/env/SDETools/bin',
'VIRTUALENVWRAPPER_WORKON_CD=1',
'DISPLAY=/private/tmp/com.apple.launchd.l5D2fBdDbT/org.macosforge.xquartz:0',
'SECURITYSESSIONID=1873e',
'=/usr/local/bin/macaca' ],
stderr: <Buffer 78 63 6f 64 65 2d 73 65 6c 65 63 74 3a 20 65 72 72 6f 72 3a 20 74 6f 6f 6c 20 27 78 63 6f 64 65 62 75 69 6c 64 27 20 72 65 71 75 69 72 65 73 20 58 63 ... >,
stdout: ,
pid: 52204,
output:
[ null,
,
<Buffer 78 63 6f 64 65 2d 73 65 6c 65 63 74 3a 20 65 72 72 6f 72 3a 20 74 6f 6f 6c 20 27 78 63 6f 64 65 62 75 69 6c 64 27 20 72 65 71 75 69 72 65 73 20 58 63 ... > ],
signal: null,
status: 1 }
Xcode is uninstalled
iproxy[usbmuxd] is installed at:
/usr/local/bin/iproxy
Command Line Tools: ios_webkit_debug_proxy is uninstalled
Android checklist:
JAVA version is
1.8
JAVA_HOME is set to
/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home
ANDROID_HOME is set to
/Users/lihaokai/Library/Android/sdk
Platforms is set to
/Users/lihaokai/Library/Android/sdk/platforms/android-28
ADB tool is set to
/Users/lihaokai/Library/Android/sdk/platform-tools/adb
gradle is installed, version: 4.1
Installed driver list:
android: 2.0.48
Operate System:
Mac
Programming Language:
Java
在Android7,8上针对apk测试,在某些全屏页面(虚拟导航栏自动隐藏)使用driver.source()获取当前页面信息,缺失了大部分页面信息:
2018-11-13 16:22:13 Request:http://localhost:3456/wd/hub/session/e1f11fb9-5709-4210-8f99-5ded9863f0de/source
2018-11-13 16:22:13 Response:{"sessionId":"e1f11fb9-5709-4210-8f99-5ded9863f0de","status":0,"value":"{"index":"0","class":"android.view.View","package":"android","checkable":"false","checked":"false","clickable":"false","enabled":"true","focusable":"false","focused":"false","scrollable":"false","long-clickable":"false","password":"false","selected":"false","bounds":"[2156,0][2246,1080]"}"}
实际使用app-inspector反而能够获取所有的信息:
在Android6上不能复现上述问题。
The text was updated successfully, but these errors were encountered: