Michael
Michael

Reputation: 11

Element not found in the cache - perhaps the page has changed since it was looked up

I'm using Watir webdriver to click on all the links with the same title on a webpage.

browser.links(:title => 'Hide week').each(&:click)

However, it sometimes happens and I get this error message:

Element not found in the cache - perhaps the page has changed since it was looked up

I need the program to click on a 'turn editing on' button first, then the page will reload and configuration buttons/icons will show. Then each(&:click) should click on the buttons/icons. Is there another way of clicking on a group of links that can avoid 'Element not found in the cache'?

Thank you.

Upvotes: 0

Views: 1260

Answers (1)

Sham
Sham

Reputation: 840

There is no other way apart from initializing the elements again, before clicking them.

Upvotes: 0

Related Questions