← Back to team overview

sikuli-driver team mailing list archive

[Bug 1662784] [NEW] [1.1.1] Android - ADB: input not working correctly

 

Public bug reported:

reported by https://github.com/kainecy
at https://github.com/RaiMan/SikuliX-2014/issues/210#issuecomment-278236117
--------------------------

There is no space between input text and the actual text to be typed.

public void input(String text) {
    try {
        text = text.replaceAll("\\s+", "%s");
      device.executeShell("input text ", text);
      RunTime.pause(text.length() * inputDelay);
    } catch (Exception e) {
      log(-1, "input: %s", e);
    }
  }
Also I'm replacing all the spaces with %s, otherwise adb server will raise an error.

To test them I changed org.sikuli.android.ADBTest.basicTest to the
following:

private static void basicTest(ADBScreen adbs) throws FindFailed {
    log(lvl, "**************** running basic test");
    adbs.aSwipeLeft();
    adbs.aSwipeRight();
    adbs.wait(1f);
    ScreenImage sIMg = adbs.userCapture("Android");
    sIMg.save(RunTime.get().fSikulixStore.getAbsolutePath(), "android");
    Image img = new Image(sIMg);
    adbs.aTap(img);
    adbs.wait(1f);
    sIMg = adbs.userCapture("Android");
    sIMg.save(RunTime.get().fSikulixStore.getAbsolutePath(), "android");
    img = new Image(sIMg);
    adbs.aTap(img);
    adbs.wait(1f);
    adbs.aInput("Hello world");
  }

** Affects: sikuli
     Importance: High
     Assignee: RaiMan (raimund-hocke)
         Status: Fix Committed

** Changed in: sikuli
       Status: New => Fix Committed

** Changed in: sikuli
   Importance: Undecided => High

** Changed in: sikuli
     Assignee: (unassigned) => RaiMan (raimund-hocke)

** Changed in: sikuli
    Milestone: None => 1.1.1

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1662784

Title:
  [1.1.1] Android - ADB: input not working correctly

Status in Sikuli:
  Fix Committed

Bug description:
  reported by https://github.com/kainecy
  at https://github.com/RaiMan/SikuliX-2014/issues/210#issuecomment-278236117
  --------------------------

  There is no space between input text and the actual text to be typed.

  public void input(String text) {
      try {
          text = text.replaceAll("\\s+", "%s");
        device.executeShell("input text ", text);
        RunTime.pause(text.length() * inputDelay);
      } catch (Exception e) {
        log(-1, "input: %s", e);
      }
    }
  Also I'm replacing all the spaces with %s, otherwise adb server will raise an error.

  To test them I changed org.sikuli.android.ADBTest.basicTest to the
  following:

  private static void basicTest(ADBScreen adbs) throws FindFailed {
      log(lvl, "**************** running basic test");
      adbs.aSwipeLeft();
      adbs.aSwipeRight();
      adbs.wait(1f);
      ScreenImage sIMg = adbs.userCapture("Android");
      sIMg.save(RunTime.get().fSikulixStore.getAbsolutePath(), "android");
      Image img = new Image(sIMg);
      adbs.aTap(img);
      adbs.wait(1f);
      sIMg = adbs.userCapture("Android");
      sIMg.save(RunTime.get().fSikulixStore.getAbsolutePath(), "android");
      img = new Image(sIMg);
      adbs.aTap(img);
      adbs.wait(1f);
      adbs.aInput("Hello world");
    }

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1662784/+subscriptions


Follow ups