From the course: Advanced Selenium: Automation Frameworks

Creating automation - Selenium Tutorial

From the course: Advanced Selenium: Automation Frameworks

Start my 1-month free trial

Creating automation

- Hi, I'm Jain and I'm here to talk to you about test automation in Selenium. In this course, we're going to take a tour of three different automation solutions in three different languages all using Selenium. First though, let's talk a little bit about automation. Automation is about balance, timing, and reaction. Balance. Remember, you need a balanced approach to testing. Remembering that large scale end to end tests, or journey tests, make up the smallest part of the testing pyramid after small scale unit tests and medium scale integration tests. Selenium is just a small part of that automation pyramid. Timing. Your tests need to finish quickly, but not at the cost of quality. Adjust your timing carefully and trim redundant automation steps. Reaction. A good automated test reacts to what's actually on the page, by waiting for the appropriate conditions, the appearance or the disappearance of elements, and by checking for the right data. This course presents a general introduction to automation using popular and performance Selenium frameworks. It'll teach you the basics that you need to know to get started automating in the languages and frameworks featured here. Whether you're a complete beginner or you're a seasoned automator who's looking to branch out, this course should have something interesting for you. Before we begin, I'd like to note that this course will not necessarily teach you how to construct a complete testing framework from end to end. There are some key features of good framework design that you'll need to understand on your journey to becoming an expert automator, iterative development, design patterns, like the page object model, and integration with backend services. These steps will take you beyond the horizons of this course. In this course, you'll create what's called a minimum viable product. A minimum viable product, or MVP, is a functional product but not a finished product. In the iterative development process you start small with an MVP that just gets the job done. Once you have that working proof of concept, you'll restructure your code so that it's reusable and therefore, easier to maintain. Like the evolution of a Victorian Penny Farthing into a modern electric powered bicycle, you should expect to start small and simple and then grow and refine your automation framework over time. The page object model is a design pattern for building automation frameworks where, in a nutshell, every page is represented by an object in your code. Obviously, with a trend toward single page applications, not every web application is able to be neatly divided into pages, but the page object model is a good starting point that teaches you how to divide your test automation code in a logical pattern that's similar to the structure of the application you're testing. Since UI automation with Selenium is only one part of a complete mature framework, you should also look into integrating your Selenium test code into the backend services that make your web application run. Automated tests should be divided in such a way that they're independent. That is, they don't rely on other tests to set up the data or the conditions needed in the target application. Your tests should also be isolated. If a test is isolated to just the target function of the application, you'll have a far easier time figuring out what's gone wrong when a test fails.

Contents