org.openqa.selenium.UnsupportedCommandException: touchScroll
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.3k
- Forks
- 752
- Avg merge
- 6d 21h
- Merged PRs (30d)
- 8
Description
Description
When I open h5 using chrome, I swipe the page by implementing the HasTouchScreen method, prompting failure and error
Environment
- java client build version or git revision if you use some shapshot: 6.1.0
- Appium server version or git revision if you use some shapshot: 1.8.1
- Desktop OS/version used to run Appium if necessary:
- Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe:
- Mobile platform/version under test: android
- Real device or emulator/simulator:
Details
I want to use the TouchActions scroll method, but when I implemented the HasTouchScreen interface, the page did not swipe, but directly reported an error. When I was in java-clien 5.0.4 and selenium 3.5.2 version, I could swipe normally, but I could not swipe at java-client 6.1.0 selenium 3.12.0 ~ 3.14.0, and there was an error
Code To Reproduce Issue [ Good To Have ]
public class TestCase{
//
private RemoteWebDriver driver;
RemoteTouchScreen touch;
public TouchScreen getTouch() {
return touch;
}
@Test
public void beforeMethod() {
try {
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(MobileCapabilityType.PLATFORM_NAME, "android");
caps.setCapability(MobileCapabilityType.DEVICE_NAME, "xxxxxxx");
caps.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 600);
caps.setCapability(AndroidMobileCapabilityType.NO_SIGN, true);
caps.setCapability(AndroidMobileCapabilityType.UNICODE_KEYBOARD, true);
caps.setCapability(AndroidMobileCapabilityType.RESET_KEYBOARD, true);
caps.setCapability(AndroidMobileCapabilityType.BROWSER_NAME,"Chrome");
caps.setCapability(MobileCapabilityType.NO_RESET, true);
caps.setCapability(AndroidMobileCapabilityType.RECREATE_CHROME_DRIVER_SESSIONS, true);
driver = new AndroidDriverChild(new URL("http://127.0.0.1:4723/wd/hub"), caps);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
} catch (MalformedURLException e) {
e.printStackTrace();
}
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
driver.get("http://www.sogou.com");
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
TouchActions touchActions = new TouchActions(driver);
touchActions.scroll(600, 1200).perform();
public class AndroidDriverChild extends AndroidDriver implements HasTouchScreen {
private RemoteTouchScreen touch;
public AndroidDriverChild(URL remoteAddress, Capabilities desiredCapabilities) {
super(remoteAddress, desiredCapabilities);
touch = new RemoteTouchScreen(getExecuteMethod());
}
public TouchScreen getTouch() {
return touch;
}
}
}
Ecxeption stacktraces
errro log:
org.openqa.selenium.UnsupportedCommandException: touchScroll
Driver info: driver.version: AndroidDriver
at org.openqa.selenium.remote.http.AbstractHttpCommandCodec.encode(AbstractHttpCommandCodec.java:218)
at org.openqa.selenium.remote.http.AbstractHttpCommandCodec.encode(AbstractHttpCommandCodec.java:117)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:152)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:231)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at io.appium.java_client.AppiumExecutionMethod.execute(AppiumExecutionMethod.java:46)
at org.openqa.selenium.remote.RemoteTouchScreen.scroll(RemoteTouchScreen.java:64)
at org.openqa.selenium.interactions.touch.ScrollAction.perform(ScrollAction.java:46)
at org.openqa.selenium.interactions.CompositeAction.perform(CompositeAction.java:36)
at org.openqa.selenium.interactions.Actions$BuiltAction.perform(Actions.java:633)
at org.openqa.selenium.interactions.Actions.perform(Actions.java:594)
at TestCase.beforeMethod(TestCase.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:816)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1124)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
at org.testng.TestRunner.privateRun(TestRunner.java:774)
at org.testng.TestRunner.run(TestRunner.java:624)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:359)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:312)
at org.testng.SuiteRunner.run(SuiteRunner.java:261)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1215)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
at org.testng.TestNG.run(TestNG.java:1048)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:122)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Link to Appium logs
Can be provided if needed
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing RemoteTouchScreen.scroll and TouchActions.scroll through AppiumExecutionMethod and the AppiumCommandExecutor, using the reported java-client 6.1.0, Selenium 3.12.0–3.14.0, and Appium 1.8.1 versions. Reproduce the touchScroll failure with the supplied Android Chrome example and compare it with the older working versions; done means the supported scroll path works or the compatibility limitation is clearly established and covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100