Unable to select option by value using regular expression

Hi guys,

Would you know the workaround for this error “Unable to select option by value ‘Option1’ of object ‘Object Repository/ObjectFolder/select_Choose an item _9’ using regular expression (Root cause: No option matched.)”

It was the last drop-down I have selected and didn’t get any value from it.

Thank you!

script, html

SelectedPartnerStore = findTestData(‘DF_ExcelDataFiles-Q2-CoreIssue/Q2-CoreIssue-CreateCard’).getValue(‘PartnerStoreName’, row)

‘Select the dropdown value by Select option By Label Method’

WebUI.selectOptionByLabel(findTestObject(‘Object Repository/LoginToQ1-New-OR/Page_NewCardHolder-OR/Page_CoreCard/select_PartnerStore’), SelectedPartnerStore, false)

can you also post html of that select element

Hi Andrej,


Control Card Nucala-Plastic Virtual

//select[@id = ‘DbbDataCtrl_pnlPPAcctCreatedePAcctCrt5PartnerStore_’ and @name = ‘DbbDataCtrl_pnlPPAcctCreatedePAcctCrt5PartnerStore_’]

i guess those spaces are there in real too, so try to use:

WebUI.selectOptionByLabel(findTestObject('Object Repository/LoginToQ1-New-OR/Page_NewCardHolder-OR/Page_CoreCard/select_PartnerStore'), '.*'+SelectedPartnerStore+'.*', true)

basically use regexp to get rid of any white spaces before/after text in option element