Skip to content

Selendroid Swipe UnsupportedCommandException #143

Closed

Description

@cosyman

In java-client test package,I can't find Selendroid Mode Gesture Test. I known Selendroid itself has supported Swipe Touch Action.Why appium java-client in Selendroid Mode doesn't support it ?

Activity

  1. clicman commented on Dec 18, 2014

    @clicman
    Contributor

    Faced this problem today. I`ll try to slove this issue on this week.

  2. TikhomirovSergey commented on Dec 18, 2014

    @TikhomirovSergey
    Contributor

    I think it is probably the server-side problem...

  3. TikhomirovSergey commented on Dec 18, 2014

    @TikhomirovSergey
    Contributor

    It is probably the relevant issue: appium/appium#4195

  4. clicman commented on Dec 18, 2014

    @clicman
    Contributor

    Sounds sad :(

  5. clicman commented on Dec 20, 2014

    @clicman
    Contributor

    There is strange bug:

    while (true){
    TouchActions ta = new TouchActions(driver);
                ta.flick(element, 0, -50, 0).perform();
    }

    This works only if you swipe element manually at first time, then code start working.
    Any ideas or workarounds?

  6. clicman commented on Dec 30, 2014

    @clicman
    Contributor

    Solved problem by workaround. Using my own swipe implementation which using Monkey Runner inside. I think this workaround should not be contributed to java client.

  7. Jonahss commented on Jan 5, 2015

    @Jonahss
    Member

    Hey that's cool. Are you able to share your workaround somewhere (
    discuss.appium.io) for other users?

    On Mon, Dec 29, 2014 at 9:55 PM, Viktor Sidochenko <notifications@github.com

    wrote:

    Solved problem by workaround. Using my own swipe implementation which
    using Monkey Runner inside. I think this workaround should not be
    contributed to java client.

    —
    Reply to this email directly or view it on GitHub
    #143 (comment).

  8. clicman commented on Jan 5, 2015

    @clicman
    Contributor

    Ok. After NY holidays (after 12th of January).

  9. clicman commented on Jan 12, 2015

    @clicman
    Contributor

    As promised, there is workaround:
    To use this workaround you needs to add Monkey Runner dependency in your pom.xml:

    <project>
      ...
        <dependencies>
           ...
            <dependency>
                <groupId>net.sf.sociaal</groupId>
                <artifactId>chimpchat</artifactId>
                <version>22.6.3</version>
            </dependency>
            <dependency>
                <groupId>com.android.tools</groupId>
                <artifactId>sdklib</artifactId>
                <version>22.0</version>
            </dependency>
            <dependency>
                <groupId>com.android.tools.ddms</groupId>
                <artifactId>ddmlib</artifactId>
                <version>22.0</version>
            </dependency>
        </dependencies>
    </project>

    Next, you should create an instance of chimpDevice:

    public static IChimpDevice chimpDevice;
    
    public static IChimpDevice getChimpDevice() {
            if (null == adbBackend) {
                adbBackend = new AdbBackend();
            }
            //Should always dispose it, another bug workaround
            if (null != chimpDevice) {
            chimpDevice.dispose();
            }
            chimpDevice = adbBackend.waitForConnection();
            return chimpDevice;
        }

    Now use swipe like:

     if (automation.equals("selendroid")) {
                Init.getChimpDevice().drag(startX, startY, endX, endY, 30, time);
                //Probably not needed, I don`t remeber why it appered here but upper dispose should workaround it
                Thread.sleep(500);
    }
  10. clicman commented on Jan 12, 2015

    @clicman
    Contributor

    Is it helps?

  11. cosyman commented on Jan 19, 2015

    @cosyman
    Author

    Thank @clicman for your idea,now I just use adb shell input swipe as an alternative.
    Should i close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions