Android - same item has different path in different OS versions

Mobile Testing, Android App Testing.
Uzivatel
Posts: 13
Joined: Wed Oct 31, 2018 11:10 am

Android - same item has different path in different OS versions

Post by Uzivatel » Fri Nov 09, 2018 1:19 pm

Hello Ranorex people,

I am testing the trial version of Ranorex 8.3.0.
I am using simple Android native application which include different UI elements to verify Ranorex can work with them.

Issue:
I face the issue that different OS versions can handle the path to same element differently. The problem is that I want to have one set of tests and run them on different Android devices with different OS version.

Please, the concrete test example:
The test is: run the app -> close HW keyboard -> tap on combo box -> scroll the combo-box/spinner -> tap on Sunday
Devices used:
SG S4 - Android 5.0.1
SG S8 - Android 7.0
The attachment Rx_Test_Comboboz.png is no longer available
As you can see from the test, to scroll the combo-box the different paths to element are used. To be more precise, please check the snapshots from Spy.:
Rx_Test_Comboboz.png
Rx_Test_Comboboz.png (29.54 KiB) Viewed 96 times
The attachment Rx_SGS4_OS_5.0.1_Combobox.rxsnp is no longer available

Question:
How do you solve this issue with the most effective way of writing the tests?
Last edited by Uzivatel on Fri Nov 09, 2018 2:05 pm, edited 1 time in total.

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

Re: Android - same item has different path in different OS versions

Post by odklizec » Fri Nov 09, 2018 1:28 pm

Hi Monika,

Sadly, there is no snapshot attached to your post and I'm afraid, it's impossible to tell what to do without it. Ideally, post snapshot for each mentioned Android version. Thanks. There may be a way to make the xpaths applicable in both versions, but again, it's hard to tell without seeing the snapshot(s) ;)
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

Uzivatel
Posts: 13
Joined: Wed Oct 31, 2018 11:10 am

Re: Android - same item has different path in different OS versions

Post by Uzivatel » Fri Nov 09, 2018 3:05 pm

Hello,

Attachment feature works suspicious here. I think after any edit of message, the attachments get lost partially.
Nevertheless, trying again:
Rx_SGS8_OS_7.0_Combobox.rxsnp
(43.83 KiB) Downloaded 4 times
Rx_SGS4_OS_5.0.1_Combobox.rxsnp
(56.15 KiB) Downloaded 5 times
Hopefully, it works.
Attachments
Rx_SGS8_OS_7.0_Combobox.rxsnp
(43.83 KiB) Downloaded 4 times

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

Re: Android - same item has different path in different OS versions

Post by odklizec » Fri Nov 09, 2018 3:33 pm

Hi Monika,

I'm afraid, the snapshot from Android 7 device does not display the list of days, if this is what you are after? Could you please post also the xpath you got on both devices? I just don't see the difference you mentioned (except missing list of days).
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

Uzivatel
Posts: 13
Joined: Wed Oct 31, 2018 11:10 am

Re: Android - same item has different path in different OS versions

Post by Uzivatel » Wed Nov 14, 2018 3:47 pm

Hello Pavel,

sorry for response delay.
1.) I am attaching the screenshots from spy for both devices:
SGS8 _ Android 7
Rx_SGS8_Android7_Combobox.png
Rx_SGS8_Android7_Combobox.png (85.04 KiB) Viewed 44 times
SGS4 _ Android 5
Rx_SGS4_Android5_Combobox.png
Rx_SGS4_Android5_Combobox.png (84.19 KiB) Viewed 44 times
2.) I am attaching the Repository path in Ranorex I see
Rx_Combobox_Paths_In_RanorexRepository.png
Rx_Combobox_Paths_In_RanorexRepository.png (86.73 KiB) Viewed 44 times

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

Re: Android - same item has different path in different OS versions

Post by odklizec » Wed Nov 14, 2018 3:50 pm

Hi Monika,

Please post snapshots, instead of screenshots ;) Screenshots are unfortunately useless for detailed analysis of differences and finding common attributes. And please post the xpaths you found different in text form. Again, it's hard to analyze something, if one needs to retype things from picture ;) Thanks.

Just by looking at the screenshots you've posted, I can see a possible xpath common for both dropdowns...
//Form/?/*[@platformclass~'DropDownListView']
Just try it in both versions. Sadly, you will have to adapt the xpath manually in all similar cases. Also, from my previous short experience with Android, it may be better to increase xpath weight rule for "platformclass" attribute, because it contains many useful strings for more robust xpath construction. But because they contain also a lot of rubbish, you will have to manually edit each recorded/tracked xpath :D

This blog post should help you to understand and how to use xpath weight rules...
https://www.ranorex.com/blog/automated- ... namic-ids/
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