Receiving float with Wait For Condition and element count?

Im getting following console output:

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:

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 …

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

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

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” :wink: