-
Notifications
You must be signed in to change notification settings - Fork 1.4k
sb.wait_for_element_visible
ignores other matching elements
#3904
-
suppose a selector my_selector
matches 5 elements, when calling sb.wait_for_element_visible(my_selector)
, currently it finds the first matching present element, then waits for it to be visible.
The behavior I want (and I expected) is to wait for any of the matching present 5 elements to be visible.
Is this behavior expected and how can I achieve the behavior I wanted?
Beta Was this translation helpful? Give feedback.
All reactions
There are methods for that:
sb.wait_for_any_of_elements_visible(*args, **kwargs)
sb.wait_for_any_of_elements_present(*args, **kwargs)
sb.assert_any_of_elements_visible(*args, **kwargs)
sb.assert_any_of_elements_present(*args, **kwargs)
Replies: 1 comment 2 replies
-
There are methods for that:
sb.wait_for_any_of_elements_visible(*args, **kwargs)
sb.wait_for_any_of_elements_present(*args, **kwargs)
sb.assert_any_of_elements_visible(*args, **kwargs)
sb.assert_any_of_elements_present(*args, **kwargs)
Beta Was this translation helpful? Give feedback.
All reactions
-
Oh, I thought those methods are only for multiple elements with distinct selectors, not for single selector matching multiple elements.
So sb.wait_for_any_of_elements_visible(my_selector)
will wait for any element matching my_selector
to be visible, right?
Nice! Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions
-
If the same selector for multiple elements, but you just want to find the visible elements, then there’s sb.find_visible_elements(selector).
Beta Was this translation helpful? Give feedback.