# Unable to select option by value using regular expression

**URL:** <https://forum.katalon.com/t/unable-to-select-option-by-value-using-regular-expression/13650>\
**Category:** Integrations\
**Tags:** integrations, katalon-studio\
**Created:** [October 10, 2018, 5:03am UTC](https://forum.katalon.com/t/unable-to-select-option-by-value-using-regular-expression/13650 "2018-10-10T05:03:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chimbs](https://avatars.discourse-cdn.com/v4/letter/c/a698b9/32.png) [@Chimbs](https://forum.katalon.com/u/Chimbs)\
**Post date:** [October 10, 2018, 5:03am UTC](https://forum.katalon.com/t/unable-to-select-option-by-value-using-regular-expression/13650/1 "2018-10-10T05:03:26Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Andrej\_Podhajsky](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/andrej_podhajsky/32/1055_2.png) [@Andrej\_Podhajsky](https://forum.katalon.com/u/Andrej_Podhajsky)\
**Post date:** [October 10, 2018, 9:50am UTC](https://forum.katalon.com/t/unable-to-select-option-by-value-using-regular-expression/13650/2 "2018-10-10T09:50:43Z")

</div>

> **[\[TIP\] My test is BROKEN!!! NOTHING WORKS!!!!!! PLEASE HELP ME!!!!!!!!!!!!!](http://forum.katalon.com/discussion/9337/tip-my-test-is-broken-nothing-works-please-help-me)**
>
> If you find yourself saying something like the title of this post, take a deep breath and relax.  Do that BEFORE you reach for the keyboard and BEFORE you start typing.

  
script, html

---

<div class="post-metadata">

**Author:** ![Balraj\_Alladi](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Balraj\_Alladi](https://forum.katalon.com/u/Balraj_Alladi)\
**Post date:** [October 10, 2018, 6:45pm UTC](https://forum.katalon.com/t/unable-to-select-option-by-value-using-regular-expression/13650/3 "2018-10-10T18:45:17Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Andrej\_Podhajsky](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/andrej_podhajsky/32/1055_2.png) [@Andrej\_Podhajsky](https://forum.katalon.com/u/Andrej_Podhajsky)\
**Post date:** [October 10, 2018, 7:19pm UTC](https://forum.katalon.com/t/unable-to-select-option-by-value-using-regular-expression/13650/4 "2018-10-10T19:19:10Z")

</div>

can you also post html of that select element

---

<div class="post-metadata">

**Author:** ![Balraj\_Alladi](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Balraj\_Alladi](https://forum.katalon.com/u/Balraj_Alladi)\
**Post date:** [October 11, 2018, 4:01pm UTC](https://forum.katalon.com/t/unable-to-select-option-by-value-using-regular-expression/13650/5 "2018-10-11T16:01:01Z")

</div>

Hi Andrej,

HTML:

 Control Card Nucala-Plastic Virtual 

//select[@id = ‘DbbDataCtrl\_pnlPPAcctCreatedePAcctCrt5PartnerStore\_’ and @name = ‘DbbDataCtrl\_pnlPPAcctCreatedePAcctCrt5PartnerStore\_’]

---

<div class="post-metadata">

**Author:** ![Andrej\_Podhajsky](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/andrej_podhajsky/32/1055_2.png) [@Andrej\_Podhajsky](https://forum.katalon.com/u/Andrej_Podhajsky)\
**Post date:** [October 11, 2018, 5:46pm UTC](https://forum.katalon.com/t/unable-to-select-option-by-value-using-regular-expression/13650/6 "2018-10-11T17:46:16Z")

</div>

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

```auto
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
