Inheriting WebDriver Throughout Your Page Object Classes

I’ve seen (and written) several automation projects where each page class requires a constructor that takes a WebDriver object so that the page classes can access the current browser instance. There’s nothing particularly wrong with this, but I do find it a bit annoying to pass around the WebDriver like a hot potato. There’s a couple of ways to handle it and both involve inheritance.

By |2024-09-21T23:35:30-05:00December 21, 2017|Automation|15 Comments
Go to Top