Page 1 of 1

Android - same item has different path in different OS versions

Posted: Fri Nov 09, 2018 1:19 pm
by Uzivatel
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
Rx_Test_Comboboz.png
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_SGS8_OS_7.0_Combobox.rxsnp
Rx_SGS4_OS_5.0.1_Combobox.rxsnp

Question:
How do you solve this issue with the most effective way of writing the tests?

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

Posted: Fri Nov 09, 2018 1:28 pm
by odklizec
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) ;)

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

Posted: Fri Nov 09, 2018 3:05 pm
by Uzivatel
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
Rx_SGS4_OS_5.0.1_Combobox.rxsnp
Hopefully, it works.

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

Posted: Fri Nov 09, 2018 3:33 pm
by odklizec
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).

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

Posted: Wed Nov 14, 2018 3:47 pm
by Uzivatel
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
SGS4 _ Android 5
Rx_SGS4_Android5_Combobox.png
2.) I am attaching the Repository path in Ranorex I see
Rx_Combobox_Paths_In_RanorexRepository.png

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

Posted: Wed Nov 14, 2018 3:50 pm
by odklizec
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/