# Comments for Get Element Count

**URL:** <https://forum.robotframework.org/t/comments-for-get-element-count/4270>\
**Category:** Browser-Dev\
**Created:** [19 July 2022 17:56 UTC](https://forum.robotframework.org/t/comments-for-get-element-count/4270 "2022-07-19T17:56:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkorpela](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/mkorpela/32/33_2.png) [@mkorpela](https://forum.robotframework.org/u/mkorpela)\
**Post date:** [19 July 2022 17:56 UTC](https://forum.robotframework.org/t/comments-for-get-element-count/4270/1 "2022-07-19T17:56:27Z")

</div>

Topic for comments about Browser library keyword [Get Element Count](https://marketsquare.github.io/robotframework-browser/Browser.html#Get%20Element%20Count)

---

<div class="post-metadata">

**Author:** ![René](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/ren%C3%A9/32/7_2.png) [@René](https://forum.robotframework.org/u/Ren%C3%A9)\
**Post date:** [20 July 2022 16:58 UTC](https://forum.robotframework.org/t/comments-for-get-element-count/4270/2 "2022-07-20T16:58:04Z")

</div>



---

<div class="post-metadata">

**Author:** ![René](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/ren%C3%A9/32/7_2.png) [@René](https://forum.robotframework.org/u/Ren%C3%A9)\
**Post date:** [20 July 2022 17:07 UTC](https://forum.robotframework.org/t/comments-for-get-element-count/4270/3 "2022-07-20T17:07:55Z")

</div>



---

<div class="post-metadata">

**Author:** ![breakpoint25](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@breakpoint25](https://forum.robotframework.org/u/breakpoint25)\
**Post date:** [8 August 2023 21:16 UTC](https://forum.robotframework.org/t/comments-for-get-element-count/4270/4 "2023-08-08T21:16:33Z")

</div>

Does this have a timeout, where it waits until the element count condition is met? Else what is an approach to achieve that?

---

<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:** [9 August 2023 00:28 UTC](https://forum.robotframework.org/t/comments-for-get-element-count/4270/5 "2023-08-09T00:28:00Z")

</div>

Hi @breakpoint25,

The timeout is not specified in the help, so it should be the default timeout which you can adjust with [Set Browser Timeout](https://marketsquare.github.io/robotframework-browser/Browser.html#Set%20Browser%20Timeout)

Alternatively you can use [Wait For Elements State](https://marketsquare.github.io/robotframework-browser/Browser.html#Wait%20For%20Elements%20State) before `Get Element Count` to wait for the first one to be visible before doing the count

e.g.

```python
    ${xpath}= Set variable /your/xpath
    Wait For Elements State (${xpath})[1] visible 60 seconds
    ${count}= Get Element Count ${xpath}

```

Hope that helps,

Dave.

---

<div class="post-metadata">

**Author:** ![HoanAlan](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/hoanalan/32/3775_2.png) [@HoanAlan](https://forum.robotframework.org/u/HoanAlan)\
**Post date:** [25 April 2024 04:18 UTC](https://forum.robotframework.org/t/comments-for-get-element-count/4270/6 "2024-04-25T04:18:13Z")

</div>

I got an issue when use Get Element Count in Browser Library, although element is visible, it returns 0 result, sometimes it returns correct value. It doesn’t happen if I use Selenium Library
