Test automation causes massive headaches. Period. I'm pretty sure that every one of us who ever tried it knows what I mean. We end up with way too many full-stack tests, way too much reliance on Selenium/Webdriver and way too many business people thinking that "everything is equally important".
The number of ways to tackle the pain depends on the number of people involved with the solution. Unfortunately there is no ultimate solution to test automation. There are however principles that we can follow. Just as with programming. If we keep our code clean, decoupled and readable, we can eventually focus on the less technical aspects of our work.
In the Principles of painless test automation series I will share my experience about building automation frameworks. I will cover programming language agnostic thoughts, principles and solutions.
The most common pitfall we tend to fall in is replicating business logic in our test suite. Let that be unit tests that calculate the correct result of something, or integration test code that is limited by what it represents.