Page 1 of 1

Android - unable to touch/click button off screen

Posted: Fri Jan 23, 2015 2:46 pm
by lstauffer
I am working with a native Android mobile app. The app allows you to enter one or two "things". Each "thing" needs multiple information. For example, if I want to enter a car, then I need to enter some information about that car, such as make, model, year (which are all textfields) and other information about the car that are checkboxes. After entering one "thing", there is a textfield asking for additional "things" to add. At this point, I can enter "1" or "2", etc. so that more textfields and checkboxes appear for the number of "things" to add.

At the bottom of this screen is a button that needs to be clicked to evaluate the information added and move to the next screen for results.

If I enter one "thing", I can touch or click the button at the bottom and everything works perfectly.

If I enter two "things", I'm unable to touch or click the button at the bottom. And I can't figure out why.

I've checked the button to see if the xpath changes, but it doesn't. If I highlight the button after entering 2 "things", Ranorex can find it every time.

The button is at the bottom of the screen, and not in view at the time I need to touch/click it. However, it also isn't in view when I enter the first "thing", and Ranorex can touch the button just fine.

I've tried to swipe up so I can make the button visible, but that doesn't help. I've tried to use the Focus() method on the button, and the Click() method, but nothing seems to work.

I think there may be an issue with focus. I think one of the textfields is still in focus (because it looks like the cursor is on the last textfield).

Any suggestions as to how to touch/click this button on the bottom when nothing else works? Or how to get focus on the button?

Thanks!

Re: Android - unable to touch/click button off screen

Posted: Fri Jan 23, 2015 4:08 pm
by krstcs
Ranorex has a cache that is uses to speed up testing. This cache contains the last known position of the element in question. If your screen changes between the time Ranorex first finds the item and when you try to perform an action on the item, Ranorex may not be able to find it.

To get around this you can add a Validate.Exists action against the object just before the Click action. This will force Ranorex to find the item again and re-cache the new results.

It doesn't slow the test down by more than a millisecond or so, and doesn't change the actual results.

Re: Android - unable to touch/click button off screen

Posted: Thu Jan 29, 2015 4:53 pm
by lstauffer
Thank you for the reply.

I will try to find out if the button exists before clicking it. One thing I have found, is depending on the value selected in a drop down, if the first item is selected from the drop down, the button can be touched. If the other value is selected in the drop down, then the button cannot be touched. I'm thinking this is probably because when I recorded the button, the first item was selected in the drop down, not the second item. So, I may need to take a look at the xpath to see if there is something within the path indicating the first item value.

Re: Android - unable to touch/click button off screen

Posted: Fri Jan 30, 2015 3:12 pm
by krstcs
Ah, yeah, the button's XPath may be changing when different items are selected in the drop-down. Good catch.

Re: Android - unable to touch/click button off screen

Posted: Thu May 31, 2018 9:01 pm
by letterkill
I am having the same problem with the 8.1.1 version.
Is there any news about that?
Thank you

Re: Android - unable to touch/click button off screen

Posted: Fri Jun 01, 2018 8:10 am
by odklizec
Hi,

What kind of news are you looking for? Have you tried the steps mentioned in previous posts? Also, what exactly is your problem? You problem may look similar/same, but you know, without more details, there is not much anyone here can do or suggest. Please post the xpath of probematic element, snapshot (not screenshot) taken at time the test is supposed to perform click (you can add an action to create snapshot just before the touch) and exact error you are getting. Thanks.