appium / appium/java-client

ClassCastException while using TouchActions Flick

Open
#1,196 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.3k
Forks
752
Avg merge
6d 21h
Merged PRs (30d)
8

Description

Hi @mykola-mokhnach , @jlipps , @rossrowe

I am trying to use flick method of touch actions on android app but every-time i use it i get below mentioned error.

java.lang.ClassCastException: io.appium.java_client.android.AndroidDriver cannot be cast to org.openqa.selenium.interactions.HasTouchScreen

at org.openqa.selenium.interactions.touch.TouchActions.(TouchActions.java:38)

Here is the method:-
TouchActions action = new TouchActions(driver);
action.flick(100, 100);
action.perform();

My requirement is to fast scroll like flick to the bottom of the page. i know other scroll option but they are really slow. so thought of using flick but unfortunately its not working.

I am using:-
Appium version:- 1.13.0
Android Version:- 8.0
AutomationName:- UiAutomator2

Please reply at the earliest.

Regards
Syed Zubair

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the TouchActions constructor at org.openqa.selenium.interactions.touch.TouchActions.java:38 and the AndroidDriver used in the provided flick snippet. Reproduce the ClassCastException with Appium 1.13.0, Android 8.0, and UiAutomator2, then determine whether the Java client can support this interaction; done means the documented flick flow no longer fails with the cast error.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.