Timeline for Iterating through a table : Avoiding stale element exceptions (Webdriver - Python)
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 31, 2012 at 17:42 | comment | added | Sam Woods | Execute the find_element_by function to set your element object. | |
May 30, 2012 at 22:45 | comment | added | user246 | @Sam Woods What does "create all of the elements" translate to in terms of Selenium locators? | |
May 30, 2012 at 22:00 | comment | added | Sam Woods | Good answer. An alternative that avoids using xpath (which can be slow) to avoid the stale element exception (and to get a little closer to following the page object pattern), you need to create a new instance of the element each time the page is re-loaded. You can create a function called ClickLoginForUser that takes an integer for the index. In that function you would create all of the elements and interact with them so that they don't get stale. You would then call your function inside the for loop. | |
May 30, 2012 at 18:51 | comment | added | user1411110 | I am going to try this now. looks like this will work.Thanks! | |
May 30, 2012 at 18:22 | history | answered | user246 | CC BY-SA 3.0 |