[MJSONWP] Responding to client with driver.performTouch() result: null

Hi,

I am getting this error message “[MJSONWP] Responding to client with driver.performTouch() result: null” , while trying to tap an option in one of the music app, after tapping on hamburger icon in the Android device.
Could you please share your thoughts on this. Inline is the source code and error log.

Here is the sourcecode:

import static org.junit.Assert.*;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
import java.util.concurrent.TimeUnit;

import org.junit.Test;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;

import io.appium.java_client.TouchAction;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.remote.AndroidMobileCapabilityType;
import io.appium.java_client.remote.MobileCapabilityType;
import io.appium.java_client.remote.MobilePlatform;

public class practise {

@Test
public void test() throws MalformedURLException, InterruptedException {
	DesiredCapabilities cap=new DesiredCapabilities();
	cap.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.ANDROID);
	cap.setCapability(MobileCapabilityType.DEVICE_NAME, "Android device");
	cap.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, "com.package.android");
	cap.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, "com.package.android.HomeActivity");
	AndroidDriver driver =new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),cap);
	driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
	TouchAction touch=new TouchAction(driver);
    touch.tap(driver.findElementByClassName("android.widget.ImageButton")).perform();
    Thread.sleep(4000);
    touch.tap(driver.findElementByAndroidUIAutomator("new UiSelector().textMatches(\"Settings\")")).perform();
} 

}

From the UiAutomatorViewer it is clear then Menu option has the text “settings” in it.

Logs from Server:

Launching Appium with command: ‘/Applications/Appium.app/Contents/Resources/node/bin/node’ appium/build/lib/main.js --debug-log-spacing --automation-name “Appium” --platform-name “Android” --platform-version “4.4”

[Appium] Welcome to Appium v1.5.3

[Appium] Non-default server args:

[Appium] debugLogSpacing: true

[Appium] platformName: ‘Android’
[Appium] platformVersion: ‘4.4’
[Appium] automationName: ‘Appium’
[Appium] Deprecated server args:
[Appium] --platform-name => --default-capabilities ‘{“platformName”:“Android”}’
[Appium] --platform-version => --default-capabilities ‘{“platformVersion”:“4.4”}’
[Appium] --automation-name => --default-capabilities ‘{“automationName”:“Appium”}’
[Appium] Default capabilities, which will be added to each request unless overridden by desired capabilities:

[Appium] platformName: ‘Android’

[Appium] platformVersion: ‘4.4’
[Appium] automationName: ‘Appium’

[Appium] Appium REST http interface listener started on 0.0.0.0:4723

[HTTP] --> GET /wd/hub/status {}

[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[MJSONWP] Responding to client with driver.getStatus() result: {“build”:{“version”:“1.5.3”…

[HTTP] <-- GET /wd/hub/status 200 18 ms - 83

[HTTP] --> POST /wd/hub/session {“desiredCapabilities”:{“appPackage”:“com.saavn.android”,“appActivity”:“com.saavn.android.HomeActivity”,“platformName”:“Android”,“udid”:“51900LMA01”,“deviceName”:“Android device”}}

[MJSONWP] Calling AppiumDriver.createSession() with args: [{“appPackage”:"com.saavn.a…

[Appium] Creating new AndroidDriver session
[Appium] Capabilities:

[Appium] appPackage: ‘com.saavn.android’
[Appium] appActivity: ‘com.saavn.android.HomeActivity’
[Appium] platformName: ‘Android’
[Appium] udid: ‘51900LMA01’
[Appium] deviceName: ‘Android device’
[Appium] platformVersion: ‘4.4’
[Appium] automationName: ‘Appium’
[BaseDriver] Session created with session id: 620d643c-b605-4af1-baf3-ca6b86fb3b80

[debug] [AndroidDriver] Getting Java version

[AndroidDriver] Java version is: 1.8.0_45

[ADB] Checking whether adb is present

[ADB] Using adb from /Users/x2sr/Library/Android/sdk/platform-tools/adb
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices…

[debug] [ADB] 1 device(s) connected
[AndroidDriver] Using device: 51900LMA01
[ADB] Checking whether adb is present
[ADB] Using adb from /Users/x2sr/Library/Android/sdk/platform-tools/adb
[debug] [ADB] Setting device id to 51900LMA01
[AndroidDriver] App file was not listed, instead we’re going to run com.saavn.android directly on the device
[debug] [AndroidDriver] Checking whether package is present on the device
[debug] [ADB] Getting connected devices…

[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running /Users/x2sr/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“51900LMA01”,“shell”,“pm”,“list”,“packages”,“com.saavn.android”]

[AndroidDriver] Starting Android session

[debug] [ADB] Running /Users/x2sr/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“51900LMA01”,“wait-for-device”]

[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running /Users/x2sr/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“51900LMA01”,“shell”,“echo”,“ping”]

[debug] [Logcat] Starting logcat capture

[debug] [AndroidDriver] Pushing settings apk to device…
[debug] [ADB] Running /Users/x2sr/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“51900LMA01”,“install”,"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-android-driver/node_modules/io.appium.settings/bin/settings_apk-debug.apk"]

[debug] [AndroidDriver] Pushing unlock helper app to device…

[debug] [ADB] Running /Users/x2sr/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“51900LMA01”,“install”,"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-android-driver/node_modules/appium-unlock/bin/unlock_apk-debug.apk"]

[ADB] Getting device platform version

[debug] [ADB] Getting connected devices…

[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running /Users/x2sr/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“51900LMA01”,“shell”,“getprop”,“ro.build.version.release”]

[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running /Users/x2sr/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“51900LMA01”,“shell”,“dumpsys”,“window”]

[AndroidDriver] Screen already unlocked, doing nothing
[debug] [AndroidBootstrap] Watching for bootstrap disconnect
[debug] [ADB] Forwarding system: 4724 to device: 4724
[debug] [ADB] Running /Users/x2sr/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“51900LMA01”,“forward”,“tcp:4724”,“tcp:4724”]
[debug] [UiAutomator] Starting UiAutomator
[debug] [UiAutomator] Moving to state ‘starting’
[debug] [UiAutomator] Parsing uiautomator jar
[debug] [UiAutomator] Found jar name: ‘AppiumBootstrap.jar’
[debug] [ADB] Running /Users/x2sr/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“51900LMA01”,“push”,"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-android-driver/node_modules/appium-android-bootstrap/bootstrap/bin/AppiumBootstrap.jar","/data/local/tmp/"]

[debug] [ADB] Attempting to kill all uiautomator processes
[debug] [ADB] Getting all processes with uiautomator
[debug] [ADB] Getting connected devices…

[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running /Users/x2sr/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“51900LMA01”,“shell”,“ps”,“uiautomator”]

[ADB] No uiautomator process found to kill, continuing…

[debug] [UiAutomator] Starting UIAutomator
[debug] [ADB] Creating ADB subprocess with args: -P, 5037, -s, 51900LMA01, shell, uiautomator, runtest, AppiumBootstrap.jar, -c, io.appium.android.bootstrap.Bootstrap, -e, pkg, com.saavn.android, -e, disableAndroidWatchers, false, -e, acceptSslCerts, false

[debug] [UiAutomator] Moving to state ‘online’

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] json loading complete.

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Registered crash watchers.
[AndroidBootstrap] Android bootstrap socket is now connected
[debug] [ADB] Getting connected devices…
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Client connected
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running /Users/x2sr/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“51900LMA01”,“shell”,“getprop”,“ro.build.version.sdk”]

[debug] [ADB] Device API level: 22
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running /Users/x2sr/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“51900LMA01”,“shell”,“am”,“start”,"-n",“com.saavn.android/com.saavn.android.HomeActivity”,"-S","-a",“android.intent.action.MAIN”,"-c",“android.intent.category.LAUNCHER”,"-f",“0x10200000”]

[Appium] New AndroidDriver session created successfully, session 620d643c-b605-4af1-baf3-ca6b86fb3b80 added to master session list

[MJSONWP] Responding to client with driver.createSession() result: {“platform”:“LINUX”,"webSto…

[HTTP] <-- POST /wd/hub/session 200 5130 ms - 711
[HTTP] --> POST /wd/hub/session/620d643c-b605-4af1-baf3-ca6b86fb3b80/timeouts {“type”:“implicit”,“ms”:20000}
[MJSONWP] Calling AppiumDriver.timeouts() with args: [“implicit”,20000,"620d643c…

[debug] [BaseDriver] Set implicit wait to 20000ms
[MJSONWP] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/620d643c-b605-4af1-baf3-ca6b86fb3b80/timeouts 200 4 ms - 76
[HTTP] --> POST /wd/hub/session/620d643c-b605-4af1-baf3-ca6b86fb3b80/element {“using”:“class name”,“value”:“android.widget.ImageButton”}
[MJSONWP] Calling AppiumDriver.findElement() with args: [“class name”,“android.widg…
[debug] [BaseDriver] Waiting up to 20000 ms for condition
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“class name”,“selector”:“android.widget.ImageButton”,“context”:”",“multiple”:false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“class name”,“selector”:“android.widget.ImageButton”,“context”:"",“multiple”:false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘android.widget.ImageButton’ using ‘CLASS_NAME’ with the contextId: ‘’ multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.ImageButton, INSTANCE=0]

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Clearing Accessibility cache and retrying.

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘android.widget.ImageButton’ using ‘CLASS_NAME’ with the contextId: ‘’ multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.ImageButton, INSTANCE=0]

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:{“ELEMENT”:“1”}}

[debug] [AndroidBootstrap] Received command result from bootstrap

[MJSONWP] Responding to client with driver.findElement() result: {“ELEMENT”:“1”}
[HTTP] <-- POST /wd/hub/session/620d643c-b605-4af1-baf3-ca6b86fb3b80/element 200 2760 ms - 87
[HTTP] --> POST /wd/hub/session/620d643c-b605-4af1-baf3-ca6b86fb3b80/touch/perform {“actions”:[{“action”:“tap”,“options”:{“element”:“1”}}]}
[MJSONWP] Calling AppiumDriver.performTouch() with args: [[{“action”:“tap”,“options”…
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:getLocation”,“params”:{“elementId”:“1”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:getLocation”,“params”:{“elementId”:“1”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getLocation

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:{“x”:0,“y”:58}}

[debug] [AndroidBootstrap] Received command result from bootstrap

[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:getSize”,“params”:{“elementId”:“1”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:getSize”,“params”:{“elementId”:“1”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getSize

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:{“width”:112,“height”:112}}

[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“1”,“x”:56,“y”:114}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“1”,“x”:56,“y”:114}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: click

[HTTP] --> GET /wd/hub/status {}

[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[MJSONWP] Responding to client with driver.getStatus() result: {“build”:{“version”:“1.5.3”…
[HTTP] <-- GET /wd/hub/status 200 11 ms - 83

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:true}

[debug] [AndroidBootstrap] Received command result from bootstrap

[MJSONWP] Responding to client with driver.performTouch() result: null
[HTTP] <-- POST /wd/hub/session/620d643c-b605-4af1-baf3-ca6b86fb3b80/touch/perform 200 3387 ms - 76

[HTTP] --> POST /wd/hub/session/620d643c-b605-4af1-baf3-ca6b86fb3b80/element {“using”:"-android uiautomator",“value”:“new UiSelector().textMatches(“Settings”)”}

[MJSONWP] Calling AppiumDriver.findElement() with args: ["-android uiautomator","ne…

[debug] [BaseDriver] Waiting up to 20000 ms for condition
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:"-android uiautomator",“selector”:“new UiSelector().textMatches(“Settings”)”,“context”:"",“multiple”:false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:"-android uiautomator",“selector”:“new UiSelector().textMatches(“Settings”)”,“context”:"",“multiple”:false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘new UiSelector().textMatches(“Settings”)’ using ‘ANDROID_UIAUTOMATOR’ with the contextId: ‘’ multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Parsing selector: new UiSelector().textMatches(“Settings”)
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] UiSelector coerce type: class java.lang.String arg: “Settings”
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[TEXT_REGEX=Settings]

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:{“ELEMENT”:“2”}}
[debug] [AndroidBootstrap] Received command result from bootstrap
[MJSONWP] Responding to client with driver.findElement() result: {“ELEMENT”:“2”}
[HTTP] <-- POST /wd/hub/session/620d643c-b605-4af1-baf3-ca6b86fb3b80/element 200 63 ms - 87
[HTTP] --> POST /wd/hub/session/620d643c-b605-4af1-baf3-ca6b86fb3b80/touch/perform {“actions”:[{“action”:“tap”,“options”:{“element”:“1”}},{“action”:“tap”,“options”:{“element”:“2”}}]}
[MJSONWP] Calling AppiumDriver.performTouch() with args: [[{“action”:“tap”,“options”…
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:getLocation”,“params”:{“elementId”:“1”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:getLocation”,“params”:{“elementId”:“1”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getLocation

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:{“x”:0,“y”:58}}

[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:getSize”,“params”:{“elementId”:“1”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:getSize”,“params”:{“elementId”:“1”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getSize

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:{“width”:112,“height”:112}}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:getLocation”,“params”:{“elementId”:“2”}}

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:getLocation”,“params”:{“elementId”:“2”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getLocation
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:{“x”:106,“y”:1307}}

[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:getSize”,“params”:{“elementId”:“2”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:getSize”,“params”:{“elementId”:“2”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getSize
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:{“width”:135,“height”:46}}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“1”,“x”:56,“y”:114}}

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“1”,“x”:56,“y”:114}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: click

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:true}

[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“2”,“x”:173.5,“y”:1330}}

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“2”,“x”:173.5,“y”:1330}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: click

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:7,“value”:“UiSelector[TEXT_REGEX=Settings]”}

[debug] [AndroidBootstrap] Received command result from bootstrap

[HTTP] <-- POST /wd/hub/session/620d643c-b605-4af1-baf3-ca6b86fb3b80/touch/perform 500 12057 ms - 164

How does that issue go?

Seeing this issue as well. Not failing with any errors, but not working at all.