How to handle iFrames using Selenium Webdriver: switchTo()
See How to Handle iFrames in Selenium Webdriver: switchTo()
I used “By Index” which worked for me.
//Add to the imports section for use with "driver.switchTo().frame(0)"
import org.openqa.selenium.WebDriver as WebDriver
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
//Input the following anywhere in the body of your test case
WebUI.delay(5) //Sets time to wait for iframe to be visibile
WebDriver driver = DriverFactory.getWebDriver()
driver.switchTo().frame(0) // I only had 1 iframe to deal with
//When finished working in the iframe switch back to default content
WebUI.switchToDefaultContent