How to get all ID in iFRAME?

how to get all ID in iFRAME?

What do you mean by “all ID”?


**GREEN - is IFRAME contains webElements with IDRED - **requires the ALL ID of the webElements in iFrame




I need to click or get attributes from each element, but to do so I need to get a list of element IDS. Or is it possible to achieve in any other way?

They are all tab, so you can get all of them by xpath: //a, then make a loop to get all the ids.

Get all by ? i dont know a function

You can use following snippet to get all the link id

List<WebElement> allLinks = DriverFactory.webDriver.findElements(By.tagName("a"))
for (WebElement link in allLinks) {
  println link.getAttribute("id")

I imported the package and it works

import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;