Anrdoid studio emulator and Tracking element in Mobile app
Anrdoid studio emulator and Tracking element in Mobile app
Hello,
I am using Android studio as emulator to Ranorex and I am stuck somehow on a Test where I do search and should verify the returned result.
since Spy captures the UI elements first , I am not able to identify my returned search result.
any work around for that?
xpath: /mobileapp[@title='com.jivesoftware.daily.prodinternal']/form[@title='MainActivity']/androidelement[@rid='content']/androidelement/container[@containertype='Linear']/?/?/container[@containertype='Frame']/?/?/container[@containertype='Linear']/container[@containertype='Frame']
I am using Android studio as emulator to Ranorex and I am stuck somehow on a Test where I do search and should verify the returned result.
since Spy captures the UI elements first , I am not able to identify my returned search result.
any work around for that?
xpath: /mobileapp[@title='com.jivesoftware.daily.prodinternal']/form[@title='MainActivity']/androidelement[@rid='content']/androidelement/container[@containertype='Linear']/?/?/container[@containertype='Frame']/?/?/container[@containertype='Linear']/container[@containertype='Frame']
Last edited by mmahra on Thu Mar 19, 2020 11:09 am, edited 1 time in total.
Re: Anrdoid studio emulator and Tracking element in Mobile app
Hi,
At first, please post a Ranorex snapshot (NOT screenshot) of your app. Screenshot is unfortunately not very helpful.
Generally speaking, if Spy always picks an "infront" object, and not the one you are looking for, then what you must do is to search the element you are looking for manually. Simply expand the tree, and open the items one by one and check the screenshot of each individual element. This way you should be able to find the element you are looking for.
At first, please post a Ranorex snapshot (NOT screenshot) of your app. Screenshot is unfortunately not very helpful.
Generally speaking, if Spy always picks an "infront" object, and not the one you are looking for, then what you must do is to search the element you are looking for manually. Simply expand the tree, and open the items one by one and check the screenshot of each individual element. This way you should be able to find the element you are looking for.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: Anrdoid studio emulator and Tracking element in Mobile app
Thank you Pavel for your reply.
Expanding the tree is not helping much here as I was not able to find the element.
PFA
Expanding the tree is not helping much here as I was not able to find the element.
PFA
Last edited by mmahra on Thu Mar 19, 2020 11:09 am, edited 1 time in total.
Re: Anrdoid studio emulator and Tracking element in Mobile app
Hi,
Well, I can only guess that you are looking for this element?...
Well, I can only guess that you are looking for this element?...
/mobileapp[@title='com.jivesoftware.daily.prodinternal']/form[@title='MainActivity']//androidelement[@platformclass='android.support.v7.widget.CardView']/container[@containertype='Linear']/container/text[@text='myTATSpace']
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: Anrdoid studio emulator and Tracking element in Mobile app
This XPath is failing
Last edited by mmahra on Thu Mar 19, 2020 11:08 am, edited 1 time in total.
Re: Anrdoid studio emulator and Tracking element in Mobile app
Hi,
Could you please try it in spy, without actually running the test? Just open spy as if you created the snapshot and put the xpath there. Does it work then?
Could you please try it in spy, without actually running the test? Just open spy as if you created the snapshot and put the xpath there. Does it work then?
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: Anrdoid studio emulator and Tracking element in Mobile app
Hello Pavel,
the Xpath works but indicated the search bar not the returned search.
the Xpath works but indicated the search bar not the returned search.
Last edited by mmahra on Thu Mar 19, 2020 11:08 am, edited 1 time in total.
Re: Anrdoid studio emulator and Tracking element in Mobile app
Hi,
Sorry, my mistake Here is correct xpath to searched element:
Sorry, my mistake Here is correct xpath to searched element:
Basically, the easiest way to find all elements, containing certain string, is to search them from root app element, like this:/mobileapp[@title='com.jivesoftware.daily.prodinternal']/form[@title='MainActivity']/androidelement[@rid='content']/androidelement/container[@containertype='Linear']//androidelement[@platformclass='com.jivesoftware.daily.app.components.about.widgets.ContentFollowableItemView']/container//text[@text='myTATSpace']
This will return all appearances or Texts, containing searched string, in this case 'myTATSpace'. So from all returned elements, you can pick the right one and generate its exact xpath via right click menu >> Update path action./mobileapp[@title='com.jivesoftware.daily.prodinternal']//text[@text='myTATSpace']
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: Anrdoid studio emulator and Tracking element in Mobile app
Hi Pavel,
I have been trying to implement your suggestion since yesterday, it is working for text but not for hints, maybe you can suggest a solution for the attached snapshot, I am trying to locate Email address field and Password field and not able to identify caption/text/hint.
Thank you..
I have been trying to implement your suggestion since yesterday, it is working for text but not for hints, maybe you can suggest a solution for the attached snapshot, I am trying to locate Email address field and Password field and not able to identify caption/text/hint.
Thank you..
Last edited by mmahra on Thu Mar 19, 2020 11:07 am, edited 1 time in total.
Re: Anrdoid studio emulator and Tracking element in Mobile app
Hi again,
I am trying to use variables more often than exact text as it is the main purpose for me here.
I created a variable and gave it a default name and added it in the XPath as per attached text[@text='$BlogName'].
it keeps failing
I am trying to use variables more often than exact text as it is the main purpose for me here.
I created a variable and gave it a default name and added it in the XPath as per attached text[@text='$BlogName'].
it keeps failing
Last edited by mmahra on Thu Mar 19, 2020 11:07 am, edited 1 time in total.
Re: Anrdoid studio emulator and Tracking element in Mobile app
Hi,
I'm afraid that the fields/texts you are looking for are not accessible for Ranorex? I think it would require to adapt the mobile app and move the texts/hints to areas accessible for Ranorex. There is most probably nothing you can do about this on your own.
I'm afraid that the fields/texts you are looking for are not accessible for Ranorex? I think it would require to adapt the mobile app and move the texts/hints to areas accessible for Ranorex. There is most probably nothing you can do about this on your own.
mmahra wrote: ↑Thu Mar 19, 2020 4:31 amI have been trying to implement your suggestion since yesterday, it is working for text but not for hints, maybe you can suggest a solution for the attached snapshot, I am trying to locate Email address field and Password field and not able to identify caption/text/hint.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: Anrdoid studio emulator and Tracking element in Mobile app
Hi,
Variable enclosed in quotes, is no longer considered to be a variable, but simple string. The xpath with variable must be like this:
Variable enclosed in quotes, is no longer considered to be a variable, but simple string. The xpath with variable must be like this:
text[@text=$BlogName]
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: Anrdoid studio emulator and Tracking element in Mobile app
Unfortunately using,
/mobileapp[@title='com.jivesoftware.daily.prodinternal']/form[@title='ChannelNActivity']/androidelement[@rid='content']/androidelement/androidelement[1]/androidelement[3]/container[@containertype='Linear']/container[@containertype='Frame']/androidelement[1]/androidelement[1]/container[@containertype='Frame']/androidelement[1]/androidelement[1]/androidelement/androidelement[8]/container[@containertype='Linear']/container[2]/androidelement/androidelement/container[2]/container[@containertype='Linear']/text[@text=$BlogName]
Is failing
Failed to find item 'JCMRepository.ComJivesoftwareDailyProdinternal.TestBlog'.
No element found for path '/mobileapp[@title='com.jivesoftware.daily.prodinternal']/form[@title='ChannelNActivity']/androidelement[@rid='content']/androidelement/androidelement[1]/androidelement[3]/container[@containertype='Linear']/container[@containertype='Frame']/androidelement[1]/androidelement[1]/container[@containertype='Frame']/androidelement[1]/androidelement[1]/androidelement/androidelement[8]/container[@containertype='Linear']/container[2]/androidelement/androidelement/container[2]/container[@containertype='Linear']/text[@text='test blog']' at step 'androidelement' after 1116 attempts within 1m.
/mobileapp[@title='com.jivesoftware.daily.prodinternal']/form[@title='ChannelNActivity']/androidelement[@rid='content']/androidelement/androidelement[1]/androidelement[3]/container[@containertype='Linear']/container[@containertype='Frame']/androidelement[1]/androidelement[1]/container[@containertype='Frame']/androidelement[1]/androidelement[1]/androidelement/androidelement[8]/container[@containertype='Linear']/container[2]/androidelement/androidelement/container[2]/container[@containertype='Linear']/text[@text=$BlogName]
Is failing
Failed to find item 'JCMRepository.ComJivesoftwareDailyProdinternal.TestBlog'.
No element found for path '/mobileapp[@title='com.jivesoftware.daily.prodinternal']/form[@title='ChannelNActivity']/androidelement[@rid='content']/androidelement/androidelement[1]/androidelement[3]/container[@containertype='Linear']/container[@containertype='Frame']/androidelement[1]/androidelement[1]/container[@containertype='Frame']/androidelement[1]/androidelement[1]/androidelement/androidelement[8]/container[@containertype='Linear']/container[2]/androidelement/androidelement/container[2]/container[@containertype='Linear']/text[@text='test blog']' at step 'androidelement' after 1116 attempts within 1m.
Re: Anrdoid studio emulator and Tracking element in Mobile app
Hi,
Unfortunately, without seeing the app snapshot, there is nothing I or anyone else here can do or suggest. If the element is not found for given xpath, then the element most probably does not exists or its xpath is different? Please post the snapshot so we can eventually suggest what's wrong. And please, don't forget to create the snapshot exactly at the point, when you are searching for the failed xpath.
Unfortunately, without seeing the app snapshot, there is nothing I or anyone else here can do or suggest. If the element is not found for given xpath, then the element most probably does not exists or its xpath is different? Please post the snapshot so we can eventually suggest what's wrong. And please, don't forget to create the snapshot exactly at the point, when you are searching for the failed xpath.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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