Frame dose not switched

Hi Team,

I am not able switch to frame using Katalon default command and seleniun WebDriver.
So, please support to us for this scenario.

WebUI.switchToFrame(findTestObject(‘Page_DivideBuy-Interest-Free Credit/iframe_Verifying Instalment Ca’), 5)

and

WebDriver driver = DriverFactory.getWebDriver()

List totale1 = driver.findElements(By.xpath(“//*”));

println(totale1.size())

driver.switchTo().frame(“sagepayFrame”);

List totale = driver.findElements(By.xpath(“//*”));

println(totale.size())

driver.findElement(By.id(“field_password”)).sendKeys(“password”);

driver.findElement(By.id(“submit-button”)).click();