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
Feature: Generate way for SitePrism to regenerate #root_element (Fixes Stale Element) #85
Comments
Is there a workaround? |
Yes there is, but it is cumbersome (Essentially this logic is kind of what will exist when I get around to coding it). So there is a method on stale capybara elements (You can tell their stale by a debugger inspecting them returning When you detect that, you can rerun However the bigger issue is that something isn't always stale because it is stale, inside SitePrism. So the bigger issue here is to provide something more robust. Rest assured it will be fixed. But given there is no active contributions yet into the recently set up OpenCollective account, it's tough to find time to work on this project at the moment. |
@tchiaspko there is a partial fix available in a subsidiary gem now. This will tell you if the element is stale. We now need to integrate this in and find a way of finding whether a section is stale (or the element), and then re-generating. |
I have had some success by using the page.my_sections(allow_reload: true).first.my_elements Capybara warns that it's a beta feature, so be aware that they might decide to remove it in the future. |
This is interesting because I spoke to thomas a while ago about this when I was making the This "might" make this a whole lot easier now... Watch this space. |
Expected Behavior
When using a section which becomes stale, when trying to access any method or locator inside it, SitePrism should firstly try to regenerate the root_element and then if not, provide some API for doing so, to mitigate un-wanted StaleElements being caused by headers/footers being altered.
Actual Behavior
When using a section which becomes stale, when trying to access any method or locator inside it, a StaleElement is thrown
Steps to reproduce
N/A
The text was updated successfully, but these errors were encountered: