iframe fields detection by recorder issue

Ranorex Spy, Recorder, and Studio.
sakshi.
Posts: 6
Joined: Mon Dec 24, 2018 6:02 am

iframe fields detection by recorder issue

Post by sakshi. » Wed Dec 26, 2018 2:25 pm

I am trying to complete a POC in order to go with license purchase for my organization. While doing same I am not able to progress further as a window is displayed with fields whose path is detected but when run error reported says element not found. Please suggest some way to overcome this
Element Repository displays as:
Run 1:
.//div[#'apex_dialog_1']/iframe[@src='https://connectsa.northgateps.com/pls/h ... iHFshzKqfg']//span[#'select2-P413_PEXP_HRV_PEXT_CODE-container']

Run 2:
.//div[#'apex_dialog_1']/iframe[@src='https://connectsa.northgateps.com/pls/h ... UWwlQldVyA']//span[#'select2-P413_PEXP_HRV_PEXT_CODE-container']

every time a new element with post fix 1, 2...is added
Attachments
Select2P413PEXPHRVPEXTCODEContaine_Screenshot_41b126ab-8143-4fd8-8f65-67a783d2ed13.jpg
Select2P413PEXPHRVPEXTCODEContaine_Screenshot_41b126ab-8143-4fd8-8f65-67a783d2ed13.jpg (6.36 KiB) Viewed 39 times
2018-12-26_23-51-29.png
2018-12-26_23-51-29.png (113.25 KiB) Viewed 39 times
Select2P413PEXPHRVPEXTCODEContaine2_Screenshot_27c0ef7f-d45e-431a-ad30-e25be612d503.jpg
Select2P413PEXPHRVPEXTCODEContaine2_Screenshot_27c0ef7f-d45e-431a-ad30-e25be612d503.jpg (6.42 KiB) Viewed 39 times

qwertzu
Posts: 194
Joined: Wed Jan 25, 2017 11:08 am

Re: iframe fields detection by recorder issue

Post by qwertzu » Thu Dec 27, 2018 11:02 am

Hi,

It seems like the iFrame source is dynamic. One time it is "'https://connectsa.northgateps.com/pls/h ... iHFshzKqfg" the next time it is "https://connectsa.northgateps.com/pls/h ... UWwlQldVyA']".

So, I would recommend using a RegEx (Regular Expression) in your path and only using the part of the URL which stays the same.
A RegEx is defined by a ~ instead of a = in the path.
So I guess, in your case you could use the following path:

.//div[#'apex_dialog_1']/iframe[@src~'https://connectsa.northgateps.com/pls/']//span[#'select2-P413_PEXP_HRV_PEXT_CODE-container']


If this does not help, please upload a Ranorex Snapshot (No Screenshot) so we can get a picture of your application's structure.

regards, qwetzu

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

Re: iframe fields detection by recorder issue

Post by odklizec » Thu Dec 27, 2018 11:07 am

Hi,

Additionally to what qwertzu suggested, I would suggest to check this blog about automating apps with dynamic IDs...
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

sakshi.
Posts: 6
Joined: Mon Dec 24, 2018 6:02 am

Re: iframe fields detection by recorder issue

Post by sakshi. » Thu Dec 27, 2018 10:13 pm

Thanks for your reply guys.
I was able to resolve it by not selecting the iframe path and going with uniqueID or Title or Class and it works well.