Katalon unable to enter value at TextBox of Iframe

more HTML continued
https://drive.google.com/file/d/1oyzYmde2xFMspxLYpA760GbqQ8zZl5Qy/view?usp=sharing

I tried to replicate your problem on my side based on the screenshot you provided. I failed to replicate 100% your problem but, Katalon Studio worked well. I did not find anything curious about Katalon Studio in finding elements in iframe.

09-15-2018 04:52:41 PM - [FAILED] - Test Cases/AccCreateCoppaAccount/AccCreateCoppaAccount FAILED because (of) (Stack trace: com.kms.katalon.core.exception.StepFailedException: Unable to verify image ‘Object Repository/Page_Create Your Wizards Account/iframe_concat(id(wotcAccount’ present (Root cause: java.lang.IllegalArgumentException: Cannot find elements when the XPath expression is null.)

The message “when the XPath expression is null” gives me an impression that Groovy scripts in your project are incompletely compiled for some reason, and the binary class files are inconsistent. I have ever experienced similar situation some times possibly when I changed the project name, when I upgraded the Katalon Studio, when I imported source from outside, etc.

Tarun,

I would suggest to you to “force Groovy to compile all source codes from scratch, and renew class files completely”.

How to do it? It is simple.

  1. close your project, or shutdown Katalon Studio GUI.
  2. delete the /bin directory
  3. restart Katalon Studio, open the project
  4. re-run the test
1 Like

thanks finally got it working by this
import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.checkpoint.CheckpointFactory as CheckpointFactory
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testcase.TestCaseFactory as TestCaseFactory
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testdata.TestDataFactory as TestDataFactory
import com.kms.katalon.core.testobject.ObjectRepository as ObjectRepository
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WSBuiltInKeywords
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUiBuiltInKeywords
import internal.GlobalVariable as GlobalVariable
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.thoughtworks.selenium.Selenium as Selenium
import org.openqa.selenium.firefox.FirefoxDriver as FirefoxDriver
import org.openqa.selenium.WebDriver as WebDriver
import com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium as WebDriverBackedSelenium
import static org.junit.Assert.*
import java.util.regex.Pattern as Pattern
import static org.apache.commons.lang3.StringUtils.join
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW

WebUI.openBrowser(‘https://webr12accounts.com/’)

WebUI.maximizeWindow()

def driver = DriverFactory.getWebDriver()

String baseUrl = ‘https://webr12accounts.com/’

selenium = new WebDriverBackedSelenium(driver, baseUrl)

selenium.open(‘https://webr12accounts.com/’)

selenium.click(‘id=join’)

WebUI.switchToFrame(findTestObject(‘AccCreateNonCoppaAccount/iframe_wotcAccountWgbtModalIframe’), 5)

WebUI.switchToWindowIndex(findTestObject(‘AccCreateNonCoppaAccount/iframe_wotcAccountWgbtModalIframe’), FailureHandling.OPTIONAL)

WebUI.delay(4)

WebUI.waitForPageLoad(3)

selenium.type(‘id=firstname’, ‘sdss’)

selenium.type(‘id=lastname’, ‘test’)

selenium.click(‘id=dob_Year’)

selenium.select(‘id=dob_Year’, ‘label=2003’)

selenium.click(‘id=dob_Year’)

selenium.click(‘id=dob_Month’)

selenium.select(‘id=dob_Month’, ‘label=12’)

selenium.click(‘id=dob_Month’)

selenium.click(‘id=dob_Day’)

selenium.select(‘id=dob_Day’, ‘label=18’)

selenium.click(‘id=dob_Day’)

selenium.click(‘id=email’)

selenium.type(‘id=email’, ‘raymantest885@test.wigb.com’)

selenium.click(‘id=username’)

selenium.type(‘id=username’, ‘raymantest885’)

selenium.type(‘id=password’, ‘Password1!’)

selenium.type(‘id=confirmPassword’, ‘Password1!’)

selenium.type(‘id=joinCaptchaAnswer’, ‘TEST’)

selenium.click(‘id=next’)

WebUI.delay(10)

WebUI.closeBrowser()

Thanks a Ton for being with me through out