Error passing object values

I’m sure I’m doing something stupid… but what, I can’t figure it out!

In one test case I have the following…

// Add Product to Cart
newQty = (findTestObject(‘product/chain/prdQty’, [(‘qty’) : ‘//div[starts-with(@id, 'sponsored')]/div/div/input’]))

// Execute Add to Cart Test Case and verify spends
WebUI.callTestCase(findTestCase(‘Common/Add to Cart (divSponsored, btnAdd, itemQty, qtyField, action, view)’), [(‘divSponsored’) : divSponsored, (‘btnAdd’) : btnAdd, (‘itemQty’) : newQty, (‘qtyField’) : qtyField, (‘action’) : action, (‘view’) : view], FailureHandling.STOP_ON_FAILURE)

In the Add to Cart test case I have the following…

// Add Sponsored Product to Cart
WebUI.click(findTestObject(btnAdd))
WebUI.waitForElementAttributeValue(findTestObject(itemQty), qtyField, ‘1’, 10)

The issue appears to be in how I’m passing the newQty value into the test case called (because when the code in the TC called is in the same script, it works fine!) but I can’t figure out what the heck I am doing wrong… ARGH!

Resulting error is:

Reason:[31mgroovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.testobject.ObjectRepository.findTestObject() is applicable for argument types: (com.kms.katalon.core.testobject.TestObject)

Thank you!
Morgan

Hi,

newQty is TestObject type, so just pass it to waitFor… method.

WebUI.waitForElementAttributeValue(itemQty, qtyField, ‘1’, 10)

findTestObject(String pathInRepository) returns TestObject based on specified path, but you already have TestObject you need.

Wow. Thank you SO much. I can’t tell you how long I’ve been trying to get this… :beers: