Adding variable calls into the object definition

I’ve seen similar questions, but most lean towards autodetection of rows defined via XPATH so what I am curious about may be slightly different.

WebUI.setText(findTestObject('Page_Person Search/appointmentLookupForm-emplId'), EMPL_ID)'Page_Person Search/span_Search'))'Page_Person Search/selectAppointment'))

I’ve started parameterizing a test I recorded against our HR system.
the .click … selectAppointment step include the clicking of an object.
This object is a button on the screen - depending on the parameters sent to the search there could be many results returned, each with their own uniquely identified button.

This object is defined by the following id:


I already have a data table containing the id numbers which are two separate values consisting of the 8 digit string and a single digit string.

I defined those values in the data table as Empl_ID and Empl_RCD.
In looking around I tried to update the object map to call those variables based on various examples leading my object definition of this select button to be:

Name: id
Condition: equals


However when I ran the test suite it didn’t grab the Empl_ID or EMPL_RCD from the datatable.

Finding web element with id: ‘Object Repository/Page_Person Search/selectAppointment’ located by ‘By.xpath: //*[@id = ‘appointment-lookup-result-select-button-${EMPL_ID}-${Empl_RCD}’]’ in ‘30’ second(s)

I do see that at the start of the test it evaluates the variables for the test case.
Variable ‘EMPL_ID’ is set to 12345678
Variable ‘EMPL_RCD’ is set to ‘0’

Am I going about this wrong?
Is this something that’s even possible?
Will I need to code up special WebUI. commands into the script to take advantage of this?
We have a number of different elements throughout our webapp which have the unique values assigned to the button that is being pressed, and I don’t want to have to add hundreds of similar objects (and have many different tests) to walk through the same functional process but testing with different data.

I will say I am glad I got my development team to always use UNIQUE Identifiers across the front end of this web app (every table cell, every button, field, radio selector, etc). So I hope this is something that is doable.


I never followed up on this. I did solve this. I simply just made a mistake with the variable names.