How to call values from a drop down list and use it for search by function


I have a scenario where I have to select a value from the drop down list and use that value for searching a particular field. I have 7 values in the drop down and i have to search by one by one till 7th value. Each value will display some search results. As of now I was able to get the number of total options but i am not sure where exactly i have to use this count ; some array or something? Can somebody help me with this?


Hello ,

I want to make a suggestion for the problem.
Add and save the value saved in the Object repostry field to a csv file in response to the values ​​selected from the Select box.

Then save this csv file to Catalon Studio by creating a new Data Files.

Then you can use the data in the field to call the following function in order to print the value of 7 in the field.

for (def row = 1; row <= findTestData(‘ Test Data File(Data Files combobox csv files name ‘).getRowNumbers(); row = (row + 1))

WebUI.setText(findTestObject(‘test object ‘), findTestData(‘ Test Data File(Data Files combobox csv files name ‘).getValue(1,row))

Hi emine,

Thanks for the suggestion.

So my first step is to get all the values from drop down? I have used “select All Option” , but how should i save the output to csv? please suggest

Hello again ,
Select all records in select box one by one and record them in Object repostry field.

Then, add these values ​​from the Object repostry section in sequence to a cvs file with copy pase.

Please look at the image to get a better understanding.

Hello Emine,

thanks for the solution, unfortunately that didn’t work for me.

i found another work around for the problem. first i got the count of all the options those are available in the drop down using “getNumberOfTotalOption” . Then i assigned this count to a variable. then i selected options using selectOptionByIndex based on the index value starting from 0 also this is using another variable VarA. I have kept this particular call in a for loop with the condition as

  for (int VarA = 0; VarA < TotalOptions; VarA++) 

here VarA will be my first index which is zero, then TotalOptions is the count of all the options in drop down, so as long as my index is less than total count, it will run in the loop.

Thanks again,

Hello Again ,
I’m so glad you solved the problem.