WebDriver / Read elements into variables and re-use them

Viewed 5841

I have a big issue With Webdriver (Selenium 2).

In my test code, I find all the elements in the beginning of my test, and do some actions on them (like click(), checking attributes, etc.). My problem is that my page is refreshed and re-load my elements, and Webdriver don't know to recognize the elements again.

I know that I can find my elements again, but in some functions I don't know my XPath/ids, and I get just the WebElements, not XPath/IDs.

Am I right in saying that it's no possible to read elements into variables and re-use them?

2 Answers
Related