Has anybody tried using SelectOptionByLabel keyword using regex =true
I am getting below error when I try to select the month from a dropdown:
Caused by: com.kms.katalon.core.exception.StepFailedException: Unable to select option by label ‘^Jan’ of object ‘Object Repository/OES/Page_NationalStudentNumber/select_Date of Birth month’ using regular expression.
Here’s my script to select the month ‘January’ where the regex is ‘^Jan’( meaning starts with Jan ):
WebUI.selectOptionByLabel(findTestObject(‘OES/Page_NationalStudentNumber/select_Date of Birth month’), ‘^Jan’,
true)
I intend to use variable instead of hardcoding the month like below where dob[1] is variable that stores 'Jan
WebUI.selectOptionByLabel(findTestObject(‘OES/Page_NationalStudentNumber/select_Date of Birth month’), ‘^’+(dob[1]),
true)
Please let me know the correct syntax incase the above isn’t right.
Many Thanks in advance