Forum Discussion

Daksha's avatar
Daksha
Occasional Contributor
9 years ago
Solved

Touch action does not playback successfully on android device some times , hence object not found

I have faced this many times with different types of object on 3 types of android devices. (Getac, Nexus 7 and Samsung Galaxy Note, currently using Samsung Galaxy note)

I am using TestComplete mobile version 11.20.1491.7

 

Touch action event  log says touch action was successful, hence it proceeds for next script execution, but on device the 

touch action is not simulated correctly, hence getting object not found error.

If I execute same script as standalone routine, it works perfectly fine, or if rerun the project suit it may work fine again, but other times it gives error.

This is actually false alarm in our contineous regression testing.

I have tried different things .. like adding delays between the actions, using Click command, using LongTouch command etc.

But still facing the issues.

 

Has anybody else faced this issue?

Any advice on how to solve it?

 

  • Daksha's avatar
    Daksha
    9 years ago

    Thanks anhvu and Alex.

     

    My problem got resolved(hopefully as it was intermittent) after adding few more Delays between the actions.

    So basically issue is not related to press button but the latency between the action response and actual playback on the screen.

    I will try out Mobile.Device.PressButton(MobileButtonKey.mbkBack) as well when face similar issue again.

5 Replies

  • anhvu's avatar
    anhvu
    Frequent Contributor

    Hi Deksha,

     

    could you tell me the "touch" action is on instrumented object or black-box image ( image captured and saved in ImageRepository)?

    If for instrumented object, try to find the deepest object of the object you will touch, some object is covered by other object. Somehow, you can hight-line the object but you are unable to touch it with TestComplete.

     

    If black-box image, I usually use method below:

    Mobile["Device"]("Your Device Go Here")["ShellExecute"]("adb shell input tap x y")

     

    Hope this will help.

    • Daksha's avatar
      Daksha
      Occasional Contributor

      Hi anhvu,

       

      Thanks for quick response. I am using touch action on instrumented object.

      What you mean by deepest object, say currently getting error on pressing back button on mobile device, which did not get simulated on device.

      Code I used is : 

      Mobile.Device(<devicename>).PressBack() ;

       

       

      • anhvu's avatar
        anhvu
        Frequent Contributor

        Hi,

         

        1- could you try to use this Mobile["Device"](device)["PressBack"]();

         

        2- Deepest object means the latest object in the object tree. Ex: 
          Object1
                  Object1a
                       Object1aa <--This is the deepest object.

        Example: The button object may be covered by the text of the button, so try to touch/click on the "text" of the button instead of the button.