Forum Discussion

sammy04's avatar
sammy04
Occasional Contributor
24 days ago

Button is recognized but is not clickable.

Hello everyone. I need your help to figure out why the button on my mobile app (Android) is not clicked even though TestComplete recognizes it. 

The code is very simple:

if completeButton.Exists:

 Log.Message("The button exists")

 completeButton.Click()

It returns "The button exists". However, the button is not clicked.

I suspect that the issue is because the button is partly covered with home icon as the image shows. Please tell me your thought and advice to fix this error. Cheers.

 

7 Replies

  • scot1967's avatar
    scot1967
    Icon for Champion Level 1 rankChampion Level 1

    You may also want to get with your Devs.  This does not seem to be an appropriate screen presentation for the user. It could be due to screen resolution and object placement? 

    • sammy04's avatar
      sammy04
      Occasional Contributor

      Thanks for your response, Scot. I tried to execute "focusd" and "SetFocus" for my object, however it says the button object does not support these property and method. I updated the testcomplete and tried again. But the result was the same.

      Addition: I found that focus property and method are used on desktop app not on a mobile app. I'm working on a mobile application.

      • scot1967's avatar
        scot1967
        Icon for Champion Level 1 rankChampion Level 1

        Did you try the 'slow click' option.  If there is no 'focus' setting you could try to select another object and 'Tab' to the button.  I know it's clumsy but I try things like this to figure out how controls respond then the proceed accordingly.

        In the logs there should be a message logging the action performed... 

        "The button was clicked with the left mouse button.    14:36:22:212    1.51    Event" 

        Do your log show this and is there any other information there that may be useful?

        One other thing we haven't addressed yet is how the button is being mapped. I have seen instances where the wrong object was mapped by test complete because of the way I mapped it or because of how the GUI was designed.

        I still think getting with your developers about the overlapping controls is a good idea.

         

  • scot1967's avatar
    scot1967
    Icon for Champion Level 1 rankChampion Level 1

    If I see issues like this I test for the focus state, after the click as well.  You may need to force focus?  You could be hitting the button and just moving focus.  What happens if you 'slow click'? (Two clicks with a short delay between?)   It looks like you are clicking the object and not using a position so it should just find and click the center no problem.

    ... If you find my posts helpful drop me a like! 👍 Be sure to mark the best answer if you get one to help others out and to credit the one who helped you.  😎

  • Hassan_Ballan's avatar
    Hassan_Ballan
    Icon for Champion Level 1 rankChampion Level 1

    Not a mobile expert but I am confident that some basic rules applies to desktop, web, and mobile.

    To be able to interact with a element it needs to exist, be enabled, and visible on screen not just visible.

    From the log where you get the error, the error should be descriptive and the error screenshot image should also point to where it is attempting to click. If the page is still loading and the button is in transit to its final location, the click could miss the moving target.

    • sammy04's avatar
      sammy04
      Occasional Contributor

      Thanks for the response, Hassan. However, the button didn't work even though it was touched correctly. Also tried to click the indicated location, but the button still didn't work.