Forum Discussion

siv_arunprakash's avatar
siv_arunprakash
Contributor
6 years ago
Solved

TestComplete Android Application Testing - The control is invisible unable to execute action error.

Hello Everyone,

 

I have an instrumented the andriod app. TestComplete is able to find out textboxes , buttons and other controls as well using object spy. But when I try to perform actions like click, set text etc.. I get an error the control is invisible , unable to execute action.

 

When I inspected the Name mapping element in object browser in the Identification property I can see that VisibleOnScreen property is False. But actually the element is visible on the screen. Every time object spy is able to identify the controls but not able to perform action. I am not sure how to find out the overlapped element as I dont see any overlapped window or elements in the andriod application or in object browser.

 

I tried using Image based functions to click , But it fails often based on the color and image pixel tolerance. I am also not able click the controls based on coordinates.

 

Highligting the object to mobile screen also does not work. 

 

One strange behaviour is that when I tried using Javascript , for example,  trying to set text using the wText property it works , sets the expected text to textbox controls but the value of the textbox is not set and the application has validation in it so it fails.

 

Please help if anyone faced this kind of issue. It gets very complicated to build testcases using image action.

  • Hi, 

     

    I contacted support regarding this. They informed there was a similar issue and it was fixed in TestComplete 14.0

    Thanks for your help.

9 Replies

    • siv_arunprakash's avatar
      siv_arunprakash
      Contributor

      Hi Marsha_R :

       

      Thank you for your reply. Yes I have been through all the setup mentioned in the link.

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     


    siv_arunprakash wrote:

    When I inspected the Name mapping element in object browser in the Identification property I can see that VisibleOnScreen property is False. But actually the element is visible on the screen.

    Can you provide a screenshot that illustrates your former statement and provide more details as for how you've figured ot the latter?

    You did not provide your test code, thus I am guessing that you are using NameMapping (or, better, Aliases).

    If my guess is correct, I would recommend to figure out if the problem is with the mapped onscreen object or with object itself (or TestComplete).

    Try the following:

    -- Start your tested application and navigate to the screen with the problematic onscreen object;

    -- Try to locate the onscreen object using Object Spy;

    -- If Object Spy is able to identify the object, command Object Spy to locate the selected onscreen object in the Object Browser via the Highlight in Object Tree context menu command;

    -- Check in the Object Browser if the located onscreen object has any child or sibling object that can overlap it;

    -- Execute the Highlight on Screen context menu command from the Object Browser to double-check that the selected object can be located in the application and highlighted;

    -- With the required object selected in the Object Browser, call the Show Object in Name Mapping Editor context menu command and check that the correct element is activated in the NameMapping editor;

    -- Verify that the mapping properties of the activated element match those of the object from the Object Browser;

    -- Select the element in the Aliases tree and call the Find Mapped Object context menu command. Check that the correct element is selected in the NameMapping editor.

     

    If all checks from above pass, copy full object's name from either Object Browser or Object Spy (i.e. Mobile.Device().<Application>.<Activity>.<control>), paste it to the new empty function and try to execute some action (.Keys(), .Click(), etc.) over this object.

    Do the same but using aliased object name and compare the result.

    If both attempts fail with the same error, I would recommend to contact Support via the https://support.smartbear.com/message/?prod=TestComplete form.

     

    • siv_arunprakash's avatar
      siv_arunprakash
      Contributor

      Hi Alex,

       

      Thank you for your reply. I will try the following and if the issue is still not resolved , I will post the screenshot or video how I am capturing object and trying to perform action.

    • siv_arunprakash's avatar
      siv_arunprakash
      Contributor

      Hi AlexKaras ,

       

      I tried your solution step by step, but no luck. I have attached the screenshot of the issue.

      I am trying to click on the login button which is visible on the screen.

       

      Element is identified by object spy, and it is also found in Object browser.  It does not have any child elements. I am trying to click that element using keyword test item by alias mapped name and also tried with Full Name property (i,e . Mobile.Device()... ) with javascript, I get an error message action cannot be executed and control is not visible. Even I tried to click on the parent element as well but still same error.

       

      I tried to highlight on the screen in object browser, but it cannot highlight this object on screen because I see the property visibleOnScreen is False. I dont know why this is false as I could see that on Screen. I assume the problem is due to that VisibleOnScreen property. If I try to manually change that property also it fails in rerun.

       

      Please help if you have any suggestions. Thank You !

      • siv_arunprakash's avatar
        siv_arunprakash
        Contributor

        Hello,

         

        I am still not able to fix this issue, I tried all the methods I knew. Is there anyone faced this kind of issue. Please share your suggestion will be helpful.

         

        Thank you !