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:
- Open website (imdb in my case) on the page with ratings list
- Find the ratings list with
ElementsCollection movies = $$(locator)
- Call any method on
movies that invokes element search
- On the UI - change sort type so that the elements in the collection are changed
- 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
}
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 thecollectionremain unchanged, seems like proxied elements are not being re-searched if they already been searched onceDetails
Example steps:
The actual test could be found below, but the generic steps are the following:
ElementsCollection movies = $$(locator)moviesthat invokes element searchmoviescollection, so that the elements search is invoked againActual result: list
movieshas old elements not updated accordingly to UI changeExpected result: the
movieslist elements are updated and contain new items from the UII 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:
The test