I’m currently trying to automate the selection in a dropdown menu by using a CSV.
Like for exemple in the dropdown menu you can choose between :
To create users, I’d like to automate the element selection by retriving Male or Female on the CSV file.
By the way, it’s seems like the drop down is not in HTML.
Just create an internal file in data file or reference the location if you have it external. You can randomize your selection as a variable and pass that into selection option by label. Should be pretty straight forward.
Hello thanks for you answer, but how should Katalon select the element ?
Something like this:
selectOptions = findTestData(‘folderPathHere’)
Random rand = new Random()
int rowCt = selectOptions .getRowNumbers()
int rowSelect = (rand.nextInt(rowCount - 1) + 1)
String randValue = selectOptions .getValue(1, rowSelect )
WebUI.selectOptionByLabel(findTestObject(‘objectInRepoPathHere’), randValue , false)
Hello, thanks but I’m using the Katalon Recorder, should I add a script ?
ah I always write in script view. It’s very powerful and manual view and recorder both fill out most of the script for you. I’m not really sure how you would modify it without scripting if you just use record.