Forum Discussion

eddje16's avatar
eddje16
New Contributor
8 years ago

After Dialog popup the process becomes inactive on Android

Hello TC members,

 

I'm facing the following problem on my Android with TC.

 

- We select a text in a list which results in a popup.

- In the popup we select the desired value and the popup closes.

- Now we need to select a confirmation button to go to the next screen, but we cannot click on it.

 

We wrote following function for it:

 

function SelectPromotedActionButton(StopOnError)
{
WaitUntilImageButtonAppears("buttonImageView",100,StopOnError);

var SearchVars = Array("ObjectType", "ViewID", "VisibleOnScreen");
var SearchItems = Array("View", "buttonBorder" , "True");

var Button = NameMapping.Mobile.Device.Process(activeProcess)["FindChild"](SearchVars, SearchItems, 50)

 

TC cannot find var Button and therefore not click on it.

 

We made a dirty workaround for it to rotate the device to Landscape and back to Portait to activate the process again, but that is not a proper solution for it.

 

Can someone help me out? Thanks!

 

 

2 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    The object is not visible on screen as you mentioned... it's off the screen due to screen orientation, etc.  So, first of all, that's a usability bug for the app you are testing... as a SmartPhone user, it's VERY annoying for me that, if I need to do something to proceed with an app, to have to scroll the screen to get to required fields, buttons, etc. Personally, I'd report that to the developers and say, "Make this better..."

    THAT SAID... your use of "FindChild" EXPLICITLY says to only find the object if it is visible on screen... therefore, since the object is NOT visible on screen, FindChild will return an empty stub.

    I'm very new with using TestComplete to test mobile devices so I'm not familiar with some of the hiccups and gotchas... but have you tried removing that third parameter from your FindChild call? That SHOULD then find the object... then try a call to "SetFocus" or something like that, perhaps a gesture to drag the screen before the click if the click is failing because it's off screen.  In WebApps, at least, if you click an item that is scrolled off screen because of page size, TestComplete automatically scrolls for you so I don't know if Mobile testing in TC does this... if not, you should AT LEAST be able to find the object with the change I've suggested and then perhaps find some way of triggering the object that does not require it to be on screen immediately.

    • eddje16's avatar
      eddje16
      New Contributor

      The function worked just fine in earlier versions of TC.

       

      Since I upgraded to the latest version of TC, the problems occured. 

       

      I think I need to contact support about it. Thanks anyway.