Rajeev
Rajeev

Reputation: 409

capturing a browser refreshed event using Selenium Web Driver

I am writing a program to automate link validations in a site. Our site is having more than 400 links per page and we need to open each link and see it is returning a valid page i.e 200, there are other requirements as well to check if the page is a 404 redirection page etc. It means to validate 400 inks it will take about 30 minutes or so.

My design is to integrate this with the Front-End (Selenium) automation in a way that each time the browser loads a new page or browser refreshes it will trigger a new thread by passing the page source for validating all the href available.

We are not following a page object model otherwise I could trigger this in my each page.

Question here is that is there any way we can listen to a browser refresh or page load event using Selenium Web Driver?

Upvotes: 1

Views: 2168

Answers (1)

ekostadinov
ekostadinov

Reputation: 6950

Correct me if I don't understand your question, but page_refresh and page_load_event can be two very different goals for you, if you are dealing with AJAX. You can try this article about the AJAX part and this one for selenium custom events synchronization.

This solution here is the most actual I could find.

Actually Selenium is JS driver so this answers can be helpful if you want to try it too:

Upvotes: 0

Related Questions