1

Edit: There are other questions addressing the ability to interact with pages that aren't fully loaded. THIS IS NOT THAT. This is specific to the SeleniumWire driver, not just Selenium Webdriver.

I'm currently working with a project using Selenium with Chromedriver in Python 3.8, which requires manipulating a page that takes a very long time to load. As such, I'm using the page loading strategy 'eager' options.page_load_strategy = 'eager' in order to be able to manipulate certain elements of the page before it loads fully.

I set up a test that measures the time for an element to be clicked after the browser has been declared. (Effectively measuring how long the page loading is taking to the point where a constant button can be clicked). When I used the regular Selenium Webdriver, running 15 tests got me an average time of 0.7352 seconds. However, when I used the SeleniumWire Webdriver (with the only change being the change in the difference of Webdriver), my load times after 15 tests were on average 4.3745. These load times were on par as when I ran this test on Selenium Webdriver using the 'normal' (or default) page load strategy which after 15 tests were on average 4.3900.

Thus, I believe that SeleniumWire is not utilizing the page load strategy and I was looking for possible solutions. How can I make sure that SeleniumWire uses eager loading?

Ruben Helsloot
  • 10,555
  • 5
  • 17
  • 36
SamC1404
  • 11
  • 2

0 Answers0