A 从整体看比较好,全缩小了看整体比较
#9 楼 @seveniruby
没有,只是说要这样用- -
#3 楼 @nearlynie
1.0 需要用 full class name
driver.findElements(By.xpath("//android.widget.Button"));
#13 楼 @seveniruby 据说应该用 full class name,明天试试看
#4 楼 @lihuazhang 是的
#13 楼 @seveniruby 没有呢...
#10 楼 @seveniruby 搞不定了...用法应该是没问题的吧,难道是 beta 版的 bug
#6 楼 @seveniruby
find_elements_by_id 是直接用 find 找,而不是 dumpWindowHierarchy
Returning result 里的 value 找到的东西
#6 楼 @seveniruby
我把下面这个 114319-5968-1jzdzjb.xml 抓了出来,里面的节点都是 Node,不知道跟这个有没有关系
debug: transferPageSourceXML command: "D:\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe" -s emulator-5554 pull /data/local/tmp/dump.xml "C:\Users\ADMINI~1\AppData\Local\Temp\114319-5968-1jzdzjb.xml"
debug: Appium request initiated at /wd/hub/session/6ebe01d4-4cff-4a0d-b74f-ed923481e1ea
debug: Request received with params: {}
info: Responding to client with success: {"status":0,"value":{"platform":"LINUX","browserName":"","platformVersion":"4.1","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"warnings":{},"desired":{"app-package":"com.qf365.JujinShip00121","app":"D:\\Download\\QF365JujinShip00121.apk","browserName":"","version":"4.3","device":"Android","app-activity":"com.qf365.JujinShip00121.SplashActivity"},"app-package":"com.qf365.JujinShip00121","app":"D:\\Download\\QF365JujinShip00121.apk","version":"4.3","device":"Android","app-activity":"com.qf365.JujinShip00121.SplashActivity"},"sessionId":"6ebe01d4-4cff-4a0d-b74f-ed923481e1ea"}
debug: 127.0.0.1 - - "GET /wd/hub/session/6ebe01d4-4cff-4a0d-b74f-ed923481e1ea HTTP/1.1" 200 785 "-" "Python-urllib/3.2"
debug: Appium request initiated at /wd/hub/session/6ebe01d4-4cff-4a0d-b74f-ed923481e1ea/elements
debug: Request received with params: {"using":"xpath","sessionId":"6ebe01d4-4cff-4a0d-b74f-ed923481e1ea","value":"//frame"}
info: Pushing command to appium work queue: ["dumpWindowHierarchy"]
info: [BOOTSTRAP] [info] Got data from client: {"cmd":"action","action":"dumpWindowHierarchy","params":{}}
info: [BOOTSTRAP] [info] Got command of type ACTION
info: [BOOTSTRAP] [debug] Got command action: dumpWindowHierarchy
info: [BOOTSTRAP] [info] Returning result: {"value":true,"status":0}
debug: transferPageSourceXML command: "D:\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe" -s emulator-5554 pull /data/local/tmp/dump.xml "C:\Users\ADMINI~1\AppData\Local\Temp\114319-5968-1jzdzjb.xml"
info: Responding to client with success: {"status":0,"value":[],"sessionId":"6ebe01d4-4cff-4a0d-b74f-ed923481e1ea"}
debug: 127.0.0.1 - - "POST /wd/hub/session/6ebe01d4-4cff-4a0d-b74f-ed923481e1ea/elements HTTP/1.1" 200 87 "-" "Python-urllib/3.2"
driver.find_elements_by_xpath("//frame")
下面是 appium 的 log
跟 0.18 的实现机制好像不一样了,用了 dumpWindowHierarchy,但是传进去的 params 是{}
@seveniruby 试了 1.0beta,用 xpath 什么都找不到....