Capture all iframes on a page

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
KimVW
Posts: 6
Joined: Mon Feb 01, 2021 1:06 pm

Capture all iframes on a page

Post by KimVW » Thu Sep 16, 2021 4:23 pm

I have a page under test with lots of iframes, very few identifiers... when I track my items this is giving me immensely xPath expressions.

Second and more important the identifiers for the iframes are generated dynamically. Which means the test will succeed only once, next time it will fail...

I've worked with Selenium before and I know there is a way to get all the iframes on a page with something like this:
List<WebElement> iframes = wd.findElements(By.xpath("//iframe|//frame"));

Is there a way or something similar in Ranorex to capture all the iFrames from my 'page' or my 'parentItem'

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

Re: Capture all iframes on a page

Post by odklizec » Thu Sep 16, 2021 5:54 pm

Hi,

Could you please post a Ranorex snapshot (NOT screenshot) of the page in question? Without, a very least snapshot, it’s pretty hard to suggest something reasonable.

There is something called xpath axes, which helps with xpath navigation, using relationship expressions. You can find more about it here…
https://www.ranorex.com/help/latest/ran ... ntax/#Axes
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

KimVW
Posts: 6
Joined: Mon Feb 01, 2021 1:06 pm

Re: Capture all iframes on a page

Post by KimVW » Tue Oct 05, 2021 9:15 am

It appears to be working with using the relationship parameters
which you referred to.
Thanks for the help! :wink: