Appium TouchActions(driver).singleTap(element).perform() Method threw 'org.openqa.selenium.UnsupportedCommandException' exception


#1

The problem

We are trying to perform Single Tap with Android Hybrid App not working with 1.10 Appium release. But, similar action is working with 1.7.2 Appium release.

Environment
Appium version (or git revision): 1.10
Last Appium version that did not exhibit the issue (if applicable): 1.7.2
Desktop OS/version used to run Appium: Yes
Node.js version (unless using Appium.app|exe): No
Mobile platform/version under test: Android 8.0.0
Real device or emulator/simulator: Real Device
Appium CLI or Appium.app|exe: Appium.app
Selenium version : 3.141.59
Please see POM below for all dependencies.

Details
When-ever we perform single tap in hybrid app with Appium version 1.10, we are getting error “Method threw ‘org.openqa.selenium.UnsupportedCommandException’ exception.”. But, similar SingleTap function works with Appium version 1.7.2.

CLASS APP:
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.touch.TouchActions;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.WebElement.*;
import org.openqa.selenium.By;

import java.net.URL;
import java.util.Set;

public class App
{
public static void main( String[] args )
{
try{
DesiredCapabilities ds=new DesiredCapabilities();
ds.setCapability(“deviceName”,“Galaxy S9”);
ds.setCapability(“platformVersion”, “8.0.0”);
ds.setCapability(“platformName”,“Android”);
ds.setCapability(“autoWebview”,true);
ds.setCapability(“newCommandTimeout”,45000);
ds.setCapability(“clearSystemFiles”,true);
ds.setCapability(“appPackage”, “com.ati.playermax.sit.multi.in”);
ds.setCapability(“autoGrantPermissions”, true);
ds.setCapability(“appActivity”, “com.ati.playermax.sit.multi.in.SIT_Multi_IN”);

     WebDriver elementMobileDriver = new MyTouchableWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), ds);            
     WebElement element=elementMobileDriver.findElement(By.xpath("//ion-button[@class='ion-color ion-color-secondary button button-full button-large button-round button-solid hydrated']"));
     TouchActions actions=new TouchActions(elementMobileDriver);
     actions.singleTap(element).perform();          

}catch (Exception e){
    System.out.println(e.getMessage());
}

}

}

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.AndroidDriver;
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.HasTouchScreen;
import org.openqa.selenium.interactions.TouchScreen;
import org.openqa.selenium.remote.RemoteTouchScreen;
import org.openqa.selenium.remote.RemoteWebDriver;

import java.net.URL;
@SuppressWarnings( “deprecation” )
public class MyTouchableWebDriver extends AppiumDriver implements HasTouchScreen{
RemoteTouchScreen touch;

public MyTouchableWebDriver(URL remoteAddress, Capabilities desiredCapabilities) {
super(remoteAddress, desiredCapabilities);
touch = new RemoteTouchScreen(getExecuteMethod());
}

public TouchScreen getTouch() {
return touch;
}
}

POM Dependencies:

org.seleniumhq.selenium selenium-java 3.141.59 compile * com.google.code.gson htmlunit-driver * * net.sourceforge.htmlunit org.seleniumhq.selenium selenium-support 3.141.59 compile io.appium java-client 7.0.0 org.seleniumhq.selenium selenium-api 3.141.59 compile com.google.code.gson gson 2.8.5 compile org.apache.httpcomponents httpclient 4.5.6 compile cglib cglib 3.2.8 compile commons-validator commons-validator 1.6 compile org.apache.commons commons-lang3 3.8 compile commons-io commons-io 2.6 compile org.springframework spring-context 5.1.0.RELEASE compile org.aspectj aspectjweaver 1.9.1 compile org.slf4j slf4j-api 1.7.25 compile junit junit 4.12 test org.hamcrest hamcrest-library 1.3 test io.github.bonigarcia webdrivermanager 3.0.0 test * org.seleniumhq.selenium