Skip to content

Proxied elements in ElementsCollection are not re-searched #696

@JustAlexOne

Description

@JustAlexOne

After discussion on Gitter "selenide-ru" channel, it was decided to create an issue.

The problem

When the elements in ElementsCollection collection = $$(locator); are already been searched, when doing a search one more time after page content changed - the elements in the collection remain unchanged, seems like proxied elements are not being re-searched if they already been searched once

Details

Example steps:
The actual test could be found below, but the generic steps are the following:

  1. Open website (imdb in my case) on the page with ratings list
  2. Find the ratings list with ElementsCollection movies = $$(locator)
  3. Call any method on movies that invokes element search
  4. On the UI - change sort type so that the elements in the collection are changed
  5. Again, call any method on the movies collection, so that the elements search is invoked again

Actual result: list movies has old elements not updated accordingly to UI change
Expected result: the movies list elements are updated and contain new items from the UI

I could reproduce it on the imdb website, but I can't say this is due to their page design/implementation since the test below passes on older versions of Selenide - tried 4.9 and 4.7 and only fails on 4.10.01.
I assume this is somehow related to the bug 672 and a pull request 674 which was supposed to fix it.

The environment:

  • **Selenide Version:4.10.01
  • **Chrome\Firefox\IE Version:64.0.3282.119 (Official Build) (64-bit)
  • **Browser Driver Version:2.33
  • **Selenium Version:3.8.1
  • **OS Version:Mac OS Sierra - 10.11.3

The test

@Test
public void testReproxy() {
    open("http://www.imdb.com/chart/moviemeter?ref_=nv_mv_mpm_8");

    ElementsCollection movieTitles = $$x(".//td[@class='titleColumn']/a");

    // call any method, that would invoke element search
    assertEquals("Black Panther", movieTitles.get(0).getText());

    // sort movies by Release date.
    $(By.name("sort")).selectOption("Release Date");

    // now the the first movie should be "The Irishman"
    assertEquals("The Irishman", movieTitles.get(0).getText());
    // but we fail here, because the first element in movieTitles list is still Black Panther
}

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions