Giter Site home page Giter Site logo

sample-java's People

Contributors

chan-chun avatar xudafeng avatar yinxl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sample-java's Issues

java.lang.ClassCastException: com.alibaba.fastjson.JSONObject cannot be cast to com.alibaba.fastjson.JSONArray

使用项目中的apk包,运行AndroidSampleTest抛出错误,
堆栈信息:
java.lang.ClassCastException: com.alibaba.fastjson.JSONObject cannot be cast to com.alibaba.fastjson.JSONArray at macaca.client.commands.Context.getContexts(Context.java:27) at macaca.client.MacacaClient.contexts(MacacaClient.java:143) at macaca.client.AndroidSampleTest.switchToWebView(AndroidSampleTest.java:140) at macaca.client.AndroidSampleTest.test_case_1(AndroidSampleTest.java:101)

xpath定位问题

启动app后,第一次使用xpath定位可以定位到,点击到达第二个页面后,使用xpath定位就报错找不到这个元素了:java.lang.Exception: An element could not be located on the page using the given search parameters.
这个xpath是使用app-inspector定位,可以找到

如何不重新安装app

porps.put("reuse", 0);关闭模拟器,重新打开并安装app
porps.put("reuse", 1);不关闭模拟器,并安装app
这里需要设置什么值,才不会重新安装app,我看appium上有个noreset参数

运行 java 和nodejs demo,找到元素后操作元素报错

运行最新的demo,对元素进行操作时,报错:
java.lang.Exception: An unknown server-side error occurred while processing the command.

log日志:

macaca-android.js:294:10 [master] pid:964 start app with: {"package":"com.github.android_app_bootstrap","activity":"com.github.android_app_bootstrap.activity.WelcomeActivity"}
responseHandler.js:49:14 [master] pid:964 Send HTTP Respone to Client[2017-11-24 18:00:09]: {"sessionId":"8beda65d-7ba5-4a93-9bec-8ae74277dc7c","status":0,"value":"{"app":"/Users/tinating/.macaca-temp/android_app_bootstrap-debug.apk","reuse":1,"platformName":"android","udid":"cd4f47b1"}"}
responseHandler.js:11:12 [master] pid:964 Recieve HTTP Request from Client[2017-11-24 18:00:09]: method: POST url: /wd/hub/session/8beda65d-7ba5-4a93-9bec-8ae74277dc7c/element, jsonBody: {"using":"id","value":"com.github.android_app_bootstrap:id/mobileNoEditText"}
restart UIAutomatorWD server
uiautomator-client.js:61:14 [master] pid:964 INSTRUMENTATION_RESULT: shortMsg=Process crashed.

uiautomator-client.js:61:14 [master] pid:964 INSTRUMENTATION_CODE: 0

uiautomator-client.js:61:14 [master] pid:964 INSTRUMENTATION_STATUS: numtests=1

uiautomator-client.js:61:14 [master] pid:964 INSTRUMENTATION_STATUS: stream=
com.macaca.android.testing.UIAutomatorWD:
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: test=MacacaTestRunner
INSTRUMENTATION_STATUS: class=com.macaca.android.testing.UIAutomatorWD
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS_CODE: 1

uiautomator-client.js:61:14 [master] pid:964 INSTRUMENTATION_STATUS: stream=
UIAutomatorWD->http://localhost:9001<-UIAutomatorWD
INSTRUMENTATION_STATUS_CODE: 0

UIAutomatorWD http server ready
proxy.js:55:14 [master] pid:964 Proxy: /wd/hub/session/8beda65d-7ba5-4a93-9bec-8ae74277dc7c/element:POST to http://127.0.0.1:9001/wd/hub/session/8beda65d-7ba5-4a93-9bec-8ae74277dc7c/element:POST with body: {"using":"id","value":"com.github.android_app_bootstrap:id/mobileNoEditText"}
proxy.js:85:20 [master] pid:964 Got response with status 200: {"status":0,"value":{"ELEMENT":"1"},"sessionId":null}
session.js:109:14 [master] pid:964 Send HTTP Respone to Client[2017-11-24 18:00:10]: {"status":0,"value":"{"ELEMENT":"1"}","sessionId":null}
responseHandler.js:11:12 [master] pid:964 Recieve HTTP Request from Client[2017-11-24 18:00:10]: method: POST url: /wd/hub/session/8beda65d-7ba5-4a93-9bec-8ae74277dc7c/element/1/value, jsonBody: {"value":["中文+Test+12345678"]}
restart UIAutomatorWD server
uiautomator-client.js:61:14 [master] pid:964 INSTRUMENTATION_RESULT: shortMsg=Process crashed.
uiautomator-client.js:61:14 [master] pid:964
INSTRUMENTATION_CODE: 0

uiautomator-client.js:61:14 [master] pid:964 INSTRUMENTATION_STATUS: numtests=1

uiautomator-client.js:61:14 [master] pid:964 INSTRUMENTATION_STATUS: stream=
com.macaca.android.testing.UIAutomatorWD:
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: test=MacacaTestRunner
INSTRUMENTATION_STATUS: class=com.macaca.android.testing.UIAutomatorWD
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS_CODE: 1

uiautomator-client.js:61:14 [master] pid:964 INSTRUMENTATION_STATUS: stream=
uiautomator-client.js:61:14 [master] pid:964

uiautomator-client.js:61:14 [master] pid:964 UIAutomatorWD->http://localhost:9001<-UIAutomatorWD
UIAutomatorWD http server ready
proxy.js:55:14 [master] pid:964 Proxy: /wd/hub/session/8beda65d-7ba5-4a93-9bec-8ae74277dc7c/element/1/value:POST to http://127.0.0.1:9001/wd/hub/session/8beda65d-7ba5-4a93-9bec-8ae74277dc7c/element/1/value:POST with body: {"value":["中文+Test+12345678"]}
uiautomator-client.js:61:14 [master] pid:964
INSTRUMENTATION_STATUS_CODE: 0

proxy.js:85:20 [master] pid:964 Got response with status 200: {"status":13,"value":"An unknown server-side error occurred while processing the command.","sessionId":"8beda65d-7ba5-4a93-9bec-8ae74277dc7c"}
session.js:109:14 [master] pid:964 Send HTTP Respone to Client[2017-11-24 18:00:13]: {"status":13,"value":""An unknown server-side error occurred while processing the command."","sessionId":"8beda65d-7ba5-4a93-9bec-8ae74277dc7c"}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.