DEV Community

Jesse Phillips
Jesse Phillips

Posted on

4 2

You're not Making Test Automation Mistakes

This topic comes up after reading

https://blog.testproject.io/2020/10/06/common-mistakes-in-test-automation/

I attempted to respond as a comment but it did not make it through review.

Namely I take issue with "Writing WebDriver API Methods in Tests/Page Objects" as being an issue.

The premise of the issue "Having WebDriver methods in tests is a really bad idea since if there are any changes in Selenium WebDrivers API or different versions of the library"

Wrapping your third party libraries can bring the expressed benefits, but I would claim that only happens when you can create an abstraction for your particular use. Let me put it another way.

The library writer is providing an API to control the inner workings. This API is going to expose all sorts of functionality. When writing a wrapping class two things are likely to happen, you expose all of the same functionality (possibly with the same function signatures) or you cut functionality and provide a simpler interface. You will not know how the public API for selenium will be broken so even your trimmed API could need to be modified to accommodate those changes.

An abstraction on the other hand relies not on the browser interaction but the application and that is what you page objects are providing.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more