GetText from URL1 and SetText to URL2 - SetText step fails due to (see below error)

Steps to reproduce the bug.

  1. In URL 1(booking system), create a reservation
  2. After successful creation, copy the reservation (I used GetText here)
  3. Then the script opens up a new tab for the 2nd URL (where I counter check if the reservation is made)
  4. I used SetText keyword here, which is expected to paste the reservation number in the textfield…

However I am getting an error messgage:

=============== ROOT CAUSE =====================

For trouble shooting, please visit:

01-19-2024 11:11:20 AM setText(findTestObject("TestEnvironment OR/Page_Edit/GetText_ReservationNumber", s))

Elapsed time: 0.027s

Test Cases/Development Items/Create a member reservation and check booking in RMS FAILED.
groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.testobject.ObjectRepository.findTestObject() is applicable for argument types: (java.lang.String, java.lang.String) values: [TestEnvironment OR/Page_Edit/GetText_ReservationNumber, #364506]
Possible solutions: findTestObject(java.lang.String), findTestObject(java.lang.String, java.util.Map), findRequestObject(java.lang.String,
	at Create a member reservation and check booking in a member reservation and check booking in RMS:134)
	at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(
	at com.kms.katalon.core.main.TestCaseExecutor.runScript(
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(
	at com.kms.katalon.core.main.TestCaseExecutor.execute(
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(
	at com.kms.katalon.core.main.TestCaseMain$runTestCase$ Source)
1 Like

Are you saving get text value in a variable ?

1 Like


It looks like you just used findTestObject() incorrectly…

That method takes the name of the TestObject… Typically found in Object Repository…


As you said, you were trying to use setText(). Looking a little bit closer at that error log that you posted, simply move the parentheses around the name of the TestObject, like this:

setText(findTestObject("TestEnvironment OR/Page_Edit/GetText_ReservationNumber"), s)

Use “getText()” if the reservation is a like a label or some other type of tag that is not an <input>. If the reservation is in an <input>, then use “getAttribute(findTestObject(…), ‘value’)”

use getText() to fetch the value and SetText() to set the value in desired page