Android : Spy is not able to track elements which is out of screen

Ask general questions here.
priyank1989
Posts: 30
Joined: Wed Aug 14, 2019 8:59 pm

Android : Spy is not able to track elements which is out of screen

Post by priyank1989 » Tue Dec 10, 2019 11:00 pm

HI ,

I have application which UI is based on OpenGL, Application share same UI with Android and Windows.
In case of Android while I am using Tablet it able to track all elements which is visible, but elements which are not on screen its state is invisible.
If I tried to spy same thing in my Windows application I can spy all elements even though its not on screen..
Not on screen mean by its there on UI but I can see that only after scrolling horizontally .

I tried to spy elements using Android Mobile in place of Tablet.
so story is same I can only spy elements which I can see on screen ... even after scrolling horizontally I try to refresh and spy it again I cannot spy that elements.

Long story sort.. How to spy elements which is part of screen but not visible until I scroll..(in my case even after scroll it state is invisible)

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6174
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Android : Spy is not able to track elements which is out of screen

Post by odklizec » Wed Dec 11, 2019 8:58 am

Hi,

Could you please post a Ranorex snapshot (NOT screenshot) from the android app? Ideally, post two snapshots. One with element in question out of view and the second one, with element scrolled in view. And of course, post the xpath to the element.

If Ranorex spy detects an element as invisible, even after scrolling the element to view and refreshing Spy data, it sounds like a Ranorex bug. But it's something that must be checked by Ranorex folks. I'm afraid, this kind of issue could not be solved via forum. Therefore, I would suggest you to contact directly Ranorex support, via support form available here:
https://www.ranorex.com/support-query/
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

priyank1989
Posts: 30
Joined: Wed Aug 14, 2019 8:59 pm

Re: Android : Spy is not able to track elements which is out of screen

Post by priyank1989 » Wed Dec 11, 2019 4:09 pm

xpath for elements - /mobileapp[@title='com.librestream.onsight.connect']//container[@contentdescription='rootControl']/container[@contentdescription='clientControl']/container[@contentdescription='settingsStack']/container[@contentdescription='settingsView']/container[@contentdescription='contentArea']/?/?/container[@contentdescription='itemArea']


attached snapshot
Attachments
without_scroll.rxsnp
(30.29 KiB) Downloaded 10 times
with scroll and refresh.rxsnp
(30.31 KiB) Downloaded 8 times

priyank1989
Posts: 30
Joined: Wed Aug 14, 2019 8:59 pm

Re: Android : Spy is not able to track elements which is out of screen

Post by priyank1989 » Mon Dec 16, 2019 5:25 pm

any update on this ?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6174
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Android : Spy is not able to track elements which is out of screen

Post by odklizec » Tue Dec 17, 2019 9:13 am

Hi,

I'm afraid, I don't see a difference (aside file name) between both snapshots? They look identical to me? ;)

But as it seems, the invisible elements are still readable by Ranorex? But I'm afraid, you will most probably have to scroll the screen and validate that the element you want to work with has 'visible' attribute set to 'true'. And this could be a pain in case of long lists with unknown number of elements.

You will most probably have to scroll the screen in cycle (multiple times) and wait for the "appearance" of desired element. As far as I remember, EnsureVisible does not work (or work well) with mobile apps?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

priyank1989
Posts: 30
Joined: Wed Aug 14, 2019 8:59 pm

Re: Android : Spy is not able to track elements which is out of screen

Post by priyank1989 » Thu Dec 19, 2019 10:59 pm

Its two different sanpshot .
1. taken when element is not on screen
2. I took element on screen and refresh spy, but still elements visible state is false .. and thatz the problem ...

If I took elements on screen by scroll and refresh my Ranorex spy that elements should have visible state as true .. but for me its always false.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6174
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Android : Spy is not able to track elements which is out of screen

Post by odklizec » Fri Dec 20, 2019 8:19 am

Hi,

Sadly, because there are no images in both snapshots, they really appear identical to me. So I can't comment the problem. Your best chance is to contact directly Ranorex support and request a remote session with them, eventually, send them your app with detailed steps how to reproduce the problem. They will need to see the app anyway. There is no way around. My guess is, that there is something badly implemented in the app under test, so even if the elements are in visible area of screen, they still report as invisible? But of course, it could very well be also a problem in Ranorex? Unfortunately, it's hard to tell without examining the app ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

User avatar
Support Team
Site Admin
Site Admin
Posts: 12139
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Android : Spy is not able to track elements which is out of screen

Post by Support Team » Mon Dec 23, 2019 10:20 am

Hello everyone,

The RanoreXPath doesn't seem to be unique. When I search for the element in your snapshot I get two elements. The value for the "visible" property of one element is true, the other one is false. However, it seems Ranorex cannot make the element visible which is outside of the visible screen. The reason for this behavior is most probably how the application is implemented. For further analysis, we would need the application, but from my experience, I guess you will have to scroll until the element is visible in order to access it.

Regards,
Bernhard
.
Image

priyank1989
Posts: 30
Joined: Wed Aug 14, 2019 8:59 pm

Re: Android : Spy is not able to track elements which is out of screen

Post by priyank1989 » Mon Dec 30, 2019 6:16 pm

you can find two attachment in post , one without scroll in which element visible state false and that make sense .. but another attachment is one on which I scroll and take that element on screen and I refresh spy and check my element status and surprised its still false even though I can see that element on screen ..