-
Notifications
You must be signed in to change notification settings - Fork 574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IndexOutOfBounds if CollectionElement used as context does not exist #747
Comments
hm. Code fails on |
@sidelnikovmike sure it is, but it works fine for |
@CaBocuk I think that different behaviour is a bit confusing, but not critical at all. BUT If I modify your sample a bit, we get a real problem. The line below should not throw an exception, but it throws. And this is a bug in Selenide. We need to fix it. $$("not-existing-locator").first().$$("locator").shouldHave(size(0));
// for comparison, the equivalent line for a single web element works fine:
$$("not-existing-locator").first().$("locator").shouldNot(exist); |
|
@Denysss We have two options:
I personally think that the 2nd option is better. At least this is consistent with |
…t does not exist
fix #747 IndexOutOfBounds if CollectionElement used ...
The problem
If you use not existing CollectionElement as search context for a collection -> IndexOutOfBounds is thrown
Details
Such code for looking for Collections
Produces
java.lang.IndexOutOfBoundsException: Index 0 out-of-bounds for length 0
But same logic for looking for Elements
Works fine. And
$$("not-existing-locator").first().$("locator").exists();
hasfalse
value.Seems to have some kind of inconsistency. Does it work as designed?
Tell us about your environment
Selenide Version: 4.11.4
The text was updated successfully, but these errors were encountered: