How to get text list from dropdown

Hello folks,
How would I get a list of all text values from a dropdown.
For example on the ‘CURA Healthcare Service’ sample website the ‘Facility’ dropdown has 3 values:
‘Hongkong CURA Healthcare Center’, ‘Tokyo CURA Healthcare Center’ and 'Seoul CURA Healthcare Center.

I have tried using List and List but have not had luck yet.
I’ve done lots of searches but have not found any that have worked for me so far.
Does anyone have any resources they could point me to.

Imports:

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import internal.GlobalVariable as GlobalVariable

Test Case:

WebUI.openBrowser(GlobalVariable.G_SiteURL)
WebUI.click(findTestObject('Page_CuraHomepage/btn_MakeAppointment'))
WebUI.waitForPageLoad(30)
WebUI.setText(findTestObject('00_makeAppointment/input_Username_username'), 'John Doe')
WebUI.click(findTestObject('00_makeAppointment/input_Demo account_form-control_1'))
WebUI.setText(findTestObject('00_makeAppointment/input_Password_password'), 'ThisIsNotAPassword')
WebUI.click(findTestObject('00_makeAppointment/button_Login'))
WebUI.selectOptionByValue(findTestObject('00_makeAppointment/select_TokyoCURAHealthcareCenter'), 'Hongkong CURA Healthcare Center', false)
WebUI.selectOptionByValue(findTestObject('00_makeAppointment/select_TokyoCURAHealthcareCenter'), 'Tokyo CURA Healthcare Center', false)
WebUI.selectOptionByValue(findTestObject('00_makeAppointment/select_TokyoCURAHealthcareCenter'), 'Seoul CURA Healthcare Center', false)

//I can create a manual list but would like to know how I can pull the list from the object:
List<String> status = ['Hongkong CURA Healthcare Center', 'Tokyo CURA Healthcare Center', 'Seoul CURA Healthcare Center']
WebUI.click(findTestObject('00_makeAppointment/select_TokyoCURAHealthcareCenter'))
for (int cnt = 0; cnt < status.size(); cnt++) {
WebUI.verifyElementPresent(findTestObject('00_makeAppointment/select_TokyoCURAHealthcareCenter', [('Status') : status.get(cnt)]), 5)
}

If I read you right, you want to collect all the options from the drop-down. I found the below some time back on this forum.

List<String> status = new ArrayList<String>();

WebElement selectElement = WebUiCommonHelper.findWebElement(findTestObject('00_makeAppointment/select_TokyoCURAHealthcareCenter'), 10);
Select select = new Select(selectElement);
List<WebElement> options = select.getOptions();

'Loop will execute for all the rows'
for (int cnt = 0; cnt < options.size(); cnt++) {
	status.add(options.get(cnt).getText());
}

p.s. One last item if you don’t mind. You have the Boolean for selectOptionByValue set as true, yet you do not have any Regular Expression items in your Value, which is basis for using true. Personally, you should set the Boolean as false so it makes a direct comparison.

Hi Mike (@grylion54),
Thanks for the solution and the feedback about my Boolean not being set correctly; it’s now updated.

Best regards,
Dave