I’ve been unable to find a solution to my issue. I have an input field where I’m using static text with a randomly-generated number appended. I’m doing this because the page I’m testing only allows me to deactivate the test I’m running instead of letting me delete it completely once I’m finished.
In my script, I’m using
import org.apache.commons.lang.RandomStringUtils as RandomStringUtils
and using it in
WebUI.setText(findTestObject(‘Object Repository/Page_/input_Player Group Name_PlaceHoldertxtPlayerGroupName’), ‘Test_Group_’ + RandomStringUtils.randomNumeric(5))
It generates perfectly. However, within my script I then navigate to the page where it’s listed with the others like it. Since I’ve been trying to get this to work (and if/when it actually does) there is/will be other items on the page containing the name “Test_Group_”.
Any idea how to get the script to key in on the correct one?
So it appeared to me, you wanted to append 'Test_Group_' + random-string to your various TestObject names. If that is not the case, then you need to clarify. For example, perhaps you don’t want Test_Group to be part of the string stored in the variable but instead, use: