Not able to capture Dynamic objects, need help

I have the following code

def driver = DF.getWebDriver()

plan = driver.findElements(By.xpath(’//a[@title=\‘Application Number\’]’))

print(WebUI.getAttribute(plan, ‘value’))

AppID = WebUI.getText(findTestObject(‘Temp/Page_LA IE - Register Person - Deta (3)/a_${plan}’))

Application number is generated by the application and I need to read it into a global variable, so that I can pass it on to next Test Case.

While executing this script, getting following error, please help.

03-14-2018 08:01:55 PM - [ERROR] - Test Cases/New Test Case1 FAILED because (of) groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.getAttribute() is applicable for argument types: (java.util.ArrayList, java.lang.String) values: [[[[CChromeDriver: chrome on XP (4911d8bfaef9840abfc3716364d07a85)] -> xpath: //a[@title=‘Application Number’]]], …]

That is not the correct way to pass in a variable for a Test Object. Please follow tutorial from this guide:

Thanks Vinh for the suggestion, followed the guide, now it is working fine.

Vinh, when I set the GlobalVariable with a default value and then set another value in TC1, then try to print the value in TC2, I am getting the value that was set in as default value not the value set in TC1, is there not a way to set global variable in one TC1 and use it in TC2?

Hi Narendra

Is this the same question as ?

Russ Thomas said:

Hi Narendra

Is this the same question as ?

Russ, yes it is, I have it working now as explained in that thread. Thanks for looking into it.