@Dean Hicks said:
Is it possible to use a variable or test data within a Test Object?
For instance, I want to create an event in our events management system that pulls the title “Event 1” from test data (or a variable). Then, in second test case, I want to find the Event to edit it by locating and clicking the link element on that page whose label matches that same variable/test data.
Thanks in advance!
I am still new to Katalon, but from what I have seen this would not be possible, once a test is completed and a second test is run it would have to have fresh values or pre-stored variables. I do not know of a way to edit test data from running a test…
With that being said if you mean in a single test case to grab it and then use it for a dynamic value. yes you could do that.
I would do something like this:
eventOne = WebUI.getText(findTestObject(‘objectEvent’))
linkElement = WebUI.modifyObjectProperty(findTestObject(‘objectLink’), ‘xpath’, ‘equals’, ‘//*[@type=“button”][@text()="’ + eventOne + ‘"]’, false)
obviously you would want to modify the property modification based upon what you need. What this will do is create a new variable, based upon an object you predefined and add in the data pulled from event.
notice I have a " with a follow ’ this is closing off the first part and adding in the value from eventOne then follows with "] to close it off.
Is that what you where looking for?