How to capture dynamic text

Hi there, Need your advise here.
I’m going to test an application form - ‘save & retrieve function’ by KATALON.
If I click ‘Save’ in midway. The system will popup an alert msg with a dynamic reference number.
I want to capture the reference number.And then put this reference number into another text filed so that it could retrieve all the information that I input before click ‘Save’.

I tried lots of ways but failed… :frowning: Hope my question is clear enough. Thank you in advance!


it seems as easy and straightforward scenario. Where is the problem? GetText from alert popup, store it in a variable and use this variable wherever you want.

Hello Sir, Thank you for you prompt response. Maybe because I’m not familiar with coding stuff. So I tired gettext, and then Store variable as per others advise. But don’t know what’s wrong.

In my first test case: Get text as below

V2saveappID = WebUI.getText(findTestObject(‘Object Repository/Page_Third Party Deposits/span_tVvhsa’))

V2savenum = WebUI.getText(findTestObject(‘Object Repository/Page_Third Party Deposits/span_1111111’))

In my second test case, call first case then:
attribute = WebUI.getAttribute(findTestObject(‘Object Repository/Page_Third Party Deposits/span_tVvhsa’), ‘value’)

WebUI.setText(findTestObject(‘Object Repository/Page_Third Party Deposits/input_Application ID_applicationID’), ‘V2saveappID’)

WebUI.setText(findTestObject(‘Object Repository/Page_Third Party Deposits/input_Intermediary reference number_intermediaryRefNo’),

Hard to say what’s wrong. Do you get any exception?