# Receiving float with Wait For Condition and element count?

**URL:** <https://forum.robotframework.org/t/receiving-float-with-wait-for-condition-and-element-count/7771>\
**Category:** Browser\
**Created:** [4 September 2024 12:38 UTC](https://forum.robotframework.org/t/receiving-float-with-wait-for-condition-and-element-count/7771 "2024-09-04T12:38:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rasjani](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@rasjani](https://forum.robotframework.org/u/rasjani)\
**Post date:** [4 September 2024 12:38 UTC](https://forum.robotframework.org/t/receiving-float-with-wait-for-condition-and-element-count/7771/1 "2024-09-04T12:38:02Z")

</div>

Im getting following console output:

```python
New User Signup Workflow Inbox Count: 0 - waiting for new ...
| FAIL |
Element count for selector `id=inbox_pane >> table >> nth=1 >> tr` is '0' (int) should be greater than '0.0' (float)

```

This is coming from a keyword:

```robotframework
Wait For New Email
  [Documentation] Short description.

  ${count}= Email Count
  Log To Console Inbox Count: ${count} - waiting for new ...
  Wait For Condition
  ... Element Count
  ... id=inbox_pane >> table >> nth=1 >> tr
  ... >
  ... ${count}
  ... timeout=360 seconds

```

Obviously, in this case the failure is expected as no new email did not arrive in time however, the assert with `Element Count` fails and it prints out that the other value was int and another was float.

Since i did print out of `count` variable already and it was `0` – is `Element Count` actually returning a float of elements it wound with given selector ? That feels a bit wonky …

---

<div class="post-metadata">

**Author:** ![falcon030](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/falcon030/32/3420_2.png) [@falcon030](https://forum.robotframework.org/u/falcon030)\
**Post date:** [4 September 2024 14:32 UTC](https://forum.robotframework.org/t/receiving-float-with-wait-for-condition-and-element-count/7771/2 "2024-09-04T14:32:47Z")

</div>

@rasjani You are receiving this error because the condition is not met within the specified timeout.

---

<div class="post-metadata">

**Author:** ![CharlieScene](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/charliescene/32/3484_2.png) [@CharlieScene](https://forum.robotframework.org/u/CharlieScene)\
**Post date:** [4 September 2024 20:29 UTC](https://forum.robotframework.org/t/receiving-float-with-wait-for-condition-and-element-count/7771/3 "2024-09-04T20:29:34Z")

</div>

Hi,

Seems strange indeed, I would expect also an integer for the count, as the _Get Element Count_ would return.

In your case with the _Wait For Condition_, it seems that browser passes trough waiters.py then uses getters.py, and line 634 I see this:

```
        count = response.body
        return float_str_verify_assertion(
            int(count),
            assertion_operator,
            assertion_expected,
            f"Element count for selector `{selector}` is",
            message,

```

So it indeed returns an integer for the value, but I would say the issue lies in the float\_str assertion check?

Maybe also as workaround converting the value in RF or use WHILE loop would work in your case?

Regards  
Charlie

---

<div class="post-metadata">

**Author:** ![rasjani](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@rasjani](https://forum.robotframework.org/u/rasjani)\
**Post date:** [5 September 2024 08:57 UTC](https://forum.robotframework.org/t/receiving-float-with-wait-for-condition-and-element-count/7771/4 "2024-09-05T08:57:58Z")

</div>

Yes but the error is correct - condition didnt happen and thus the fail was expected. Its just the logging part that says the value was float that bugs me and i would condider as “cosmetic bug” 😉
