This is my first post on stackoverflow, even though i've been lurking in the shadows for past 10 years. :D So, I have a task to scrape data off of a site which contains 3 cascade select lists / dropdowns, call it what ever you like. As I've played around selenium, I thought of giving a try with it. BUT I keep getting this : "OpenQA.Selenium.StaleElementReferenceException"
I get the gist of it:
1) I declare a first list "Makes" of IWebElements which load up with all elements from first dropdown. => **works fine**
2) Then I iterate through the list using foreach, something like
foreach (var make in makes)
{
make.click() // step 3
... // step 4
}
3.As seen above I click on the first element so it can fetch data for another dropdown
4.I point to another list "Models" and repeat the process for iterating the second list and console.writeline it's content.
So it gives me first element from the first list "makes", all of members from the second list "Models", as it is supposed to. But as soon as it proceeds to another member of the first list (first foreach), it says that Make is stale "OpenQA.Selenium.StaleElementReferenceException"
Cheers!