# List not found (dropdown list)

**URL:** <https://forum.robotframework.org/t/list-not-found-dropdown-list/6151>\
**Category:** Robot Framework\
**Created:** [4 September 2023 12:03 UTC](https://forum.robotframework.org/t/list-not-found-dropdown-list/6151 "2023-09-04T12:03:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lieutrinh](https://avatars.discourse-cdn.com/v4/letter/l/a88e4f/32.png) [@lieutrinh](https://forum.robotframework.org/u/lieutrinh)\
**Post date:** [4 September 2023 12:03 UTC](https://forum.robotframework.org/t/list-not-found-dropdown-list/6151/1 "2023-09-04T12:03:26Z")

</div>

I want to select an item from list by value but show error “List with locator not found”  
Element like below picture, I tried many xpath but still not found.  
Could you help me or any suggestion.  
#//_[@id=“singe\_select\_payment\_month\_id\_chosen”]/div/ul  
#//_[@id=“singe\_select\_payment\_month\_id\_chosen”]/div  
#//\*[@id=“singe\_select\_payment\_month\_id\_chosen”]

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/6/6161a4dc44c62d061ad850bb4287851699fbf2ac.png)

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [5 September 2023 08:19 UTC](https://forum.robotframework.org/t/list-not-found-dropdown-list/6151/2 "2023-09-05T08:19:42Z")

</div>

Hi Lieu,

Without more information on what your trying to do, all I can do is take a guess at your issue

Based on your dom, `//[@id=“singe_select_payment_month_id_chosen”]/div/ul` should be `//div[@id=“singe_select_payment_month_id_chosen”]/div/ul`, in xpath you need something before the square brace ([)

But I’m curious about your error being “List not found (dropdown list)”, are you trying to use a keyword like [Select From List By Value](https://robotframework.org/SeleniumLibrary/SeleniumLibrary.html#Select%20From%20List%20By%20Value) or [Get List Items](https://robotframework.org/SeleniumLibrary/SeleniumLibrary.html#Get%20List%20Items)? those list keywords are for [\<select\> \<option\> lists (Form Elements)](https://www.w3schools.com/html/html_form_elements.asp), not [Unordered or Ordered Lists](https://www.w3schools.com/html/html_lists.asp)

Hope that helps

Dave.

---

<div class="post-metadata">

**Author:** ![lieutrinh](https://avatars.discourse-cdn.com/v4/letter/l/a88e4f/32.png) [@lieutrinh](https://forum.robotframework.org/u/lieutrinh)\
**Post date:** [10 September 2023 12:40 UTC](https://forum.robotframework.org/t/list-not-found-dropdown-list/6151/3 "2023-09-10T12:40:53Z")

</div>

Hi Dave,

Yes I tried to use keyword “Select From List By Value”.  
I also tried your suggestion, but it shown error like picture.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/0/0ce0bee602d2bb24c9a1e6755a3d2150eac8bbaa.png)

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [11 September 2023 04:21 UTC](https://forum.robotframework.org/t/list-not-found-dropdown-list/6151/4 "2023-09-11T04:21:47Z")

</div>

Hi Lieu,

Not sure why you’re getting that error, perhaps the double quote marks (`"`) are not the standard ASCII double quote marks but rather the other slanted ones ones that sometimes happen.

Usually I construct and test the xpath in dev tools then just copy to my test case.

As i previously mentioned `Select From List By Value` is not for selecting items from a `<ul>` type list, so it’s still not clear what you are trying to acheive.

Dave.

---

<div class="post-metadata">

**Author:** ![lieutrinh](https://avatars.discourse-cdn.com/v4/letter/l/a88e4f/32.png) [@lieutrinh](https://forum.robotframework.org/u/lieutrinh)\
**Post date:** [17 September 2023 05:22 UTC](https://forum.robotframework.org/t/list-not-found-dropdown-list/6151/5 "2023-09-17T05:22:19Z")

</div>

Hi Dave,

I’ve been learning robot FW, so I tried to run keyword “Select From List By Value”.  
And I just copy xpath on Chrome browser. I am still not understand xpath honestly.  
The dropdown I want to test in below image. Could you suggest to me more option or information.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/1/10dd4d8342cfe7f1cc88fa43cc095721f88ebbb9.jpeg)

Thank you so much.

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [17 September 2023 05:52 UTC](https://forum.robotframework.org/t/list-not-found-dropdown-list/6151/6 "2023-09-17T05:52:55Z")

</div>

Hi Lieu,

As I mentioned before the keyword `Select From List By Value` is not suitable for your HTML, it’s only for option lists.

I know what you show in your screenshot “looks” like an option list, but it’s not an option list, this is something that is becoming more common these days.

FYI the HTML for an option list would look like this:

```python
<select>
    <option value="0">All</option>
    <option value="1">Oct-23</option>
    <option value="2">Sep-23</option>
    <option value="3">Aug-23</option>
    <option value="4">Jul-23</option>
    <option value="5">Jun-23</option>
    <option value="6">May-23</option>
    <option value="7">Apr-23</option>
    <option value="8">Mar-23</option>
    <option value="8">Feb-23</option>
</select>

```

What you also need to know this is nothing to do with robot framework either, if you used any other automation tool’s option list functions to interact with this page it would fail for the same reason.

What you probably need to do is use a Click, Wait for, Click combination, something like this:

```python
    Click Link //div[@id='singe_select_payment_month_id_chosen']/a
    Wait Until Element Is Visible //div[@id=“singe_select_payment_month_id_chosen”]//ul/li[text()='May-23']
    Click Element //div[@id=“singe_select_payment_month_id_chosen”]//ul/li[text()='May-23']

```

If you need to do this often then you could wrap this in a keyword and pass in variables for ID (`singe_select_payment_month_id_chosen`) and Value (‘May-23’)

Hopefully that helps you understand why it doesn’t work as you expected.

Dave.

---

<div class="post-metadata">

**Author:** ![lieutrinh](https://avatars.discourse-cdn.com/v4/letter/l/a88e4f/32.png) [@lieutrinh](https://forum.robotframework.org/u/lieutrinh)\
**Post date:** [17 September 2023 06:43 UTC](https://forum.robotframework.org/t/list-not-found-dropdown-list/6151/7 "2023-09-17T06:43:08Z")

</div>

Hi Dave,

I got your point and thank you so much 😊  
I did follow your suggestion and I run successfully.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/d/d9ca234b8de929d7e2e6d139639b0727650d1c8f.png)

Thanks,  
Lieu.
