Search code examples
javascriptiosautomated-testsappiumios-ui-automation

Appium error: uncaughtException: Cannot read property 'executeAtom' of null


I am doing iOS Mobile Application Testing using Selenium. I am using respectives

  1. Appium version 1.3.7
  2. Node JS version 2.7.5
  3. ios webkit debug proxy
  4. iPhone 5c
  5. Xcode version 6.1

I am using a shell script which is helping me to check the ios_webkit_debug_proxy is available or not. If not exists, within 2 seconds, it will start the ios_webkit_debug_proxy.

My testing is working well. But still facing some problem in appium that Appium is stopped certainly giving an uncaught exception: Cannot read property 'executeAtom' of null

I have tried to solve in various ways.

  1. Restart Appium and run again.
  2. Update the appium version to stable latest version 1.4.0. But the error is still remaining.
  3. Update the Node JS.
  4. Xcode is always opened in run execution time.
  5. Nullify the implicitly wait before every WebDriverWait happens. Link: http://chon.techliminal.com/ajax_wait/#/intro
  6. Using java uncaught exception handler in every related class. Link: https://bharatonjava.wordpress.com/2012/09/04/uncaughtexceptionhandler-in-java/

But still error is remaining. Would you please suggest me how I can solve this problem??

For your better understanding I am attaching the log file below.

info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Remote debugger data sent [{"method":"Runtime.evaluate","params":{"objectGroup":"console","includeCommandLineAPI":true,"doNotPauseOnExceptionsAndMuteConsole":true,"expression":"(function(){return function(){function h(a){return...]
Debugger web socket received data :  {"result":{"result":{"type":"string","value":"{\"status\":0,\"value\":[]}"},"wasThrown":false},"id":57}
info: [debug] Waited for 7659ms so far
info: --> POST /wd/hub/session/d102c79f-f695-4fbb-a020-45caf2af7b05/context {"name":"NATIVE_APP"}
info: [debug] Attempting to set context to 'NATIVE_APP'
info: [debug] Responding to client with success: {"status":0,"value":"","sessionId":"d102c79f-f695-4fbb-a020-45caf2af7b05"}
info:  POST /wd/hub/session/d102c79f-f695-4fbb-a020-45caf2af7b05/context {"name":"NATIVE_APP"}

info: [debug] Attempting to set context to 'NATIVE_APP'
info: [debug] Responding to client with success: {"status":0,"value":"","sessionId":"d102c79f-f695-4fbb-a020-45caf2af7b05"}
info: POST /wd/hub/session/d102c79f-f695-4fbb-a020-45caf2af7b05/context 200 0.862 ms - 74 {"status":0,"value":"","sessionId":"d102c79f-f695-4fbb-a020-45caf2af7b05"}
error: uncaughtException: Cannot read property 'executeAtom' of null date=Fri May 22 2015 11:40:38 GMT+0600 (BDT), pid=9153, uid=501, gid=20, cwd=/Applications/Appium.app/Contents/Resources/node_modules/appium, execPath=/Applications/Appium.app/Contents/Resources/node/bin/node, version=v0.12.1, argv=[/Applications/Appium.app/Contents/Resources/node/bin/node, /Applications/Appium.app/Contents/Resources/node_modules/appium/lib/server/main.js, --command-timeout, 7200, --platform-version, 7.1, --platform-name, iOS, --app, com.bjitgroup.putter, --udid, 0b72ccc692943f83fa2f83e78e8b3030a760fa5f, --device-name, iPhone 5], rss=218198016, heapTotal=187542272, heapUsed=76792360, loadavg=[1.51611328125, 1.689453125, 1.67431640625], uptime=71672, trace=[column=14, file=/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/ios-controller.js,
 function=iOSController.executeAtom, line=647, method=executeAtom, native=false, column=10, file=/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/ios-controller.js,
  function=, line=311, method=null, native=false, column=13, file=/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/common.js,
   function=, line=90, method=null, native=false, column=5, file=/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/common.js,
    function=, line=66, method=null, native=false, column=15, file=timers.js, function=Timer.listOnTimeout, line=110, method=listOnTimeout, native=false],
 stack=[TypeError: Cannot read property 'executeAtom' of null,
      at iOSController.executeAtom (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/ios-controller.js:647:14),
           at null. (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/ios-controller.js:311:10),
                at null. (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/common.js:90:13),
                     at null. (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/common.js:66:5),
                          at Timer.listOnTimeout (timers.js:110:15)]

Solution

  • please follow this link in github. I have got a solution that is happening because of async error.

    https://github.com/appium/appium/issues/5177