# Select dropdown value by read data from excel

**URL:** <https://forum.katalon.com/t/select-dropdown-value-by-read-data-from-excel/12207>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [July 24, 2018, 6:45am UTC](https://forum.katalon.com/t/select-dropdown-value-by-read-data-from-excel/12207 "2018-07-24T06:45:36Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![nazneen](https://avatars.discourse-cdn.com/v4/letter/n/e79b87/32.png) [@nazneen](https://forum.katalon.com/u/nazneen)\
**Post date:** [July 24, 2018, 6:45am UTC](https://forum.katalon.com/t/select-dropdown-value-by-read-data-from-excel/12207/1 "2018-07-24T06:45:36Z")

</div>

I wants to choose select value from dropdown list and data will be read through excel file. I have write piece of code. still its not work. Please anybody can help.  
here are my code:

WebUI.selectOptionByValue(findTestObject(‘Object Repository/Add Listing/Page\_Workilo Create Listing/select\_Please SelectAssemblyCr’),

```
findTestData('Read data for Add listing').getValue("Category", row), true)
```

---

<div class="post-metadata">

**Author:** ![Arnel](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/arnel/32/6360_2.png) [@Arnel](https://forum.katalon.com/u/Arnel)\
**Post date:** [July 26, 2018, 7:53am UTC](https://forum.katalon.com/t/select-dropdown-value-by-read-data-from-excel/12207/2 "2018-07-26T07:53:38Z")

</div>

Hi Nazneen,

Does it have any error message? If so, can you provide?

---

<div class="post-metadata">

**Author:** ![nazneen](https://avatars.discourse-cdn.com/v4/letter/n/e79b87/32.png) [@nazneen](https://forum.katalon.com/u/nazneen)\
**Post date:** [July 26, 2018, 1:07pm UTC](https://forum.katalon.com/t/select-dropdown-value-by-read-data-from-excel/12207/3 "2018-07-26T13:07:51Z")

</div>

> [Arnel](https://forum.katalon.com/profile/7314/Arnel "Link: /profile/7314/Arnel") said:
> 
> Hi Nazneen,
> 
> Does it have any error message? If so, can you provide?

Hi Anrel  
Its working fine now and I appreciate for your reply but you are quite late 🙂 I hope next time you will respond quickly  
Thanks 🙂

---

<div class="post-metadata">

**Author:** ![chetan.mistry](https://avatars.discourse-cdn.com/v4/letter/c/9de053/32.png) [@chetan.mistry](https://forum.katalon.com/u/chetan.mistry)\
**Post date:** [January 9, 2019, 8:18am UTC](https://forum.katalon.com/t/select-dropdown-value-by-read-data-from-excel/12207/4 "2019-01-09T08:18:33Z")

</div>

Hi Nazneen,

what you make changes in your code? now i am facing same issue.

---

<div class="post-metadata">

**Author:** ![nazneen](https://avatars.discourse-cdn.com/v4/letter/n/e79b87/32.png) [@nazneen](https://forum.katalon.com/u/nazneen)\
**Post date:** [January 11, 2019, 7:36am UTC](https://forum.katalon.com/t/select-dropdown-value-by-read-data-from-excel/12207/5 "2019-01-11T07:36:57Z")

</div>

Hi,

I have used the below code for Select dropdown

WebUI.selectOptionByValue(findTestObject(‘your chosen object’),  
findTestData(‘Read data for Name of your excel sheet’).getValue(“Name of the dropdown”, row), true)  
Hope this will help you.  
Thanks,

---

<div class="post-metadata">

**Author:** ![shubhamdixit.it](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@shubhamdixit.it](https://forum.katalon.com/u/shubhamdixit.it)\
**Post date:** [May 17, 2019, 11:19am UTC](https://forum.katalon.com/t/select-dropdown-value-by-read-data-from-excel/12207/6 "2019-05-17T11:19:34Z")

</div>

It is not working for me…

---

<div class="post-metadata">

**Author:** ![ragrawal](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/ragrawal/32/23869_2.png) [@ragrawal](https://forum.katalon.com/u/ragrawal)\
**Post date:** [August 23, 2019, 2:48am UTC](https://forum.katalon.com/t/select-dropdown-value-by-read-data-from-excel/12207/7 "2019-08-23T02:48:00Z")

</div>

Hi Nazneen,  
Can you please share your manual and scripted mode along with xpath of object repository, how did you do it. I am new to katalon.

I really need your help to complete my test case.

---

<div class="post-metadata">

**Author:** ![ritikasingh5186](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@ritikasingh5186](https://forum.katalon.com/u/ritikasingh5186)\
**Post date:** [July 1, 2020, 10:55am UTC](https://forum.katalon.com/t/select-dropdown-value-by-read-data-from-excel/12207/8 "2020-07-01T10:55:04Z")

</div>

Hi I want the code for this please it’s urgent

---

<div class="post-metadata">

**Author:** ![ayesha.khanam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/ayesha.khanam/32/16104_2.png) [@ayesha.khanam](https://forum.katalon.com/u/ayesha.khanam)\
**Post date:** [September 23, 2020, 9:29am UTC](https://forum.katalon.com/t/select-dropdown-value-by-read-data-from-excel/12207/9 "2020-09-23T09:29:55Z")

</div>

@nazneen @ragrawal@Arnel  
Can you share the working code . Have used the below code but it dint work  
WebUI.selectOptionByValue(findTestObject(‘Object Repository/Web/span\_Tanzania’), findTestData(‘data’).getValue(‘SelectCountry’,  
1), true, FailureHandling.OPTIONAL)

---

<div class="post-metadata">

**Author:** ![ragrawal](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/ragrawal/32/23869_2.png) [@ragrawal](https://forum.katalon.com/u/ragrawal)\
**Post date:** [September 23, 2020, 7:57pm UTC](https://forum.katalon.com/t/select-dropdown-value-by-read-data-from-excel/12207/10 "2020-09-23T19:57:49Z")

</div>

Hi Ayesha,

Instead of using selectOptionby value use click command and put the value in the obj repo.

If you didnt able to resolve your concern. Please let me know at [rausa1608@gmail.com](mailto:rausa1608@gmail.com)

We can discuss there thru zoom call and resolve your concern

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [September 24, 2020, 12:49am UTC](https://forum.katalon.com/t/select-dropdown-value-by-read-data-from-excel/12207/11 "2020-09-24T00:49:08Z")

</div>

@ayesha.khanam You are using **selectOptionByValue** method on a **span** element (span\_Tanzania). That won’t work. The **selectOptionByValue** and **selectOptionByLabel** methods are for a **select** tag.

Maybe you could use:

WebUI.verifyMatch(WebUI.getText(findTestObject(‘Object Repository/Web/span\_Tanzania’)), findTestData(‘data’).getValue(‘SelectCountry’,1), false, FailureHandling.OPTIONAL)

Also, you are using **true** for the boolean in your statement. If there is no Regular Expression in your parameters, you should set the boolean to **false**.

> [@How to select dropdown value according to the value on Excel sheet... Please help](http://forum.katalon.com/t/how-to-select-dropdown-value-according-to-the-value-on-excel-sheet-please-help/23918/6):
>
> [list of countries] @HeleneB It is in list No signature of method exception

---

<div class="post-metadata">

**Author:** ![ayesha.khanam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/ayesha.khanam/32/16104_2.png) [@ayesha.khanam](https://forum.katalon.com/u/ayesha.khanam)\
**Post date:** [September 25, 2020, 12:45pm UTC](https://forum.katalon.com/t/select-dropdown-value-by-read-data-from-excel/12207/12 "2020-09-25T12:45:43Z")

</div>

@grylion54 Facing below issue after changing it to WebUI.verifyMatch(WebUI.getText(findTestObject(‘Object Repository/Web/span\_Tanzania’)), findTestData(‘data’).getValue(‘SelectCountry’,1), false, FailureHandling.OPTIONAL)

groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.getText() is applicable for argument types: (com.kms.katalon.core.testobject.TestObject, java.lang.String, java.lang.Boolean, com.kms.katalon.core.model.FailureHandling) values: [TestObject - ‘Object Repository/Web/span\_Leso’, Leso, …]  
Possible solutions: getText(com.kms.katalon.core.testobject.TestObject, com.kms.katalon.core.model.FailureHandling), setText(com.kms.katalon.core.testobject.TestObject, java.lang.String, com.kms.katalon.core.model.FailureHandling), getText(com.kms.katalon.core.testobject.TestObject), setText(com.kms.katalon.core.testobject.TestObject, java.lang.String), getUrl()

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [September 25, 2020, 3:50pm UTC](https://forum.katalon.com/t/select-dropdown-value-by-read-data-from-excel/12207/13 "2020-09-25T15:50:59Z")

</div>

@ayesha.khanam The error message, **MissingMethodException** , means we do not have the statement correct. The statement does not match the proper context for parameters. In particular, the **getText** method.

If you copied and pasted from this forum, make sure all **smart** quotes, they have a curve or curl to them, are changed into **straight** quotes. (Just redo all the quotes within KS.) Also, the error message is stating **span\_Leso** , not **span\_Tanzania**. But check the type of quotes you have and then we will see if the error message goes away.

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [September 25, 2020, 5:34pm UTC](https://forum.katalon.com/t/select-dropdown-value-by-read-data-from-excel/12207/14 "2020-09-25T17:34:11Z")

</div>

Oh, and ensure you have the correct number of **closing** parenthesis on the **getText** statement of the span\_Leso statement! There should be two.

```auto
WebUI.verifyMatch(WebUI.getText(findTestObject('Object Repository/Web/span_Leso')), findTestData('data').getValue('SelectCountry',1), false, FailureHandling.OPTIONAL)

```

If you copy and paste from this forum, make sure all **smart** quotes, they have a curve or curl to them, are changed into **straight** quotes. (Just retype all the quotes within KS.)

---

<div class="post-metadata">

**Author:** ![santosh.k](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@santosh.k](https://forum.katalon.com/u/santosh.k)\
**Post date:** [January 28, 2021, 6:37am UTC](https://forum.katalon.com/t/select-dropdown-value-by-read-data-from-excel/12207/15 "2021-01-28T06:37:16Z")

</div>

Hi @ragrawal,

Am trying to select the label from the drop down by using this “WebUI.selectOptionByLabel(findTestObject(‘Invoice/ExpMonth’),findTestData(‘CTInvoice’).getValue(‘ExpirationdateMonth’, row), false)” But it’s not working could you pls help me.

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [January 28, 2021, 4:14pm UTC](https://forum.katalon.com/t/select-dropdown-value-by-read-data-from-excel/12207/16 "2021-01-28T16:14:44Z")

</div>

When you say it is not working, does it give an error message or does it not get your data?

Also, have you checked the value in **row**?  
`WebUI.comment("the row value is " + row)`
