Mastering Selenium Testing Tools
We all have felt the need to test whether our applications are performing well across different web browsers, but the sheer tedium involved in learning test scripting languages might have stopped us from doing so. What if Selenium gave us the power to control web browsers and use them to automate web application testing? As an open source test automation toolset, Selenium makes it easier for testers to evaluate web applications without putting in any extra time and effort.
Mastering Selenium Testing Tools is all about demystifying the Selenium toolset for testing websites. Testing professionals rely on a variety of test automation tools to test web applications effectively. But these tools often fail to test applications when frequent changes and enhancements are made to the code.
A viewer with a reasonable knowledge and understanding of the core elements of Selenium will learn to verify web applications, control browsers with code, and scale up the testing environment by distributing the execution of web applications on different browsers running on different operating systems.
The course starts with Selenium IDE, a Firefox plugin that performs a simple record-and-playback of interactions with the browser. A tester aiming for professional output can use WebDriver, an advanced scripting tool that will teach you to locate the elements you need to interact with using their name, id, xPath, or CSS. Testing is all about understanding what behavior is expected. If you don’t understand how it should work, how can you verify that it actually works as desired? You will learn to express the desired behavior using an executable specification and a language that your end users can read and validate. This will be done using a well-known framework for Behavior Driven Development (BDD) called Cucumber for Java.
Selenium is not just a single tool but a suite of software, each catering to the different testing needs of an organization. This course will give you a flying start towards implementing test automation using this free testing tool suite.
About The Authors
Ripon Al Wasim is currently working as a Sr. Software Engineer. He lives in Dhaka, Bangladesh. He has 13+ years of experience in the software industry. He started programming with Visual Basic. But later Ripon started to use Java and became involved in professional Java projects. He is a Sun Certified Java Programmer (SCJP). Ripon enjoys test automation very much, especially the BDD style and technique.
Thomas Sundberg is an independent consultant based in Stockholm, Sweden. He has a Master’s degree in Computer Science from the Royal Institute of Technology, KTH, in Stockholm. Thomas has been working as a developer for more than 25 years. He has taught programming at The Royal Institute of Technology, KTH, one the leading technical universities in Sweden. He has developed an obsession with technical excellence. This translates to software craftsmanship, clean code, and test automation.
He is a frequent speaker at various conferences and developer venues.
Setting Up the Work Environment
Take a peek at the entire course and all its topics.
We’ll list and highlight a set of tools, frameworks, programming languages, and plugins to fulfill a better automated test as well as cross-browser testing with Selenium.
Description of all the various tools that we need to set up and prepare the Selenium playground. We’ll take a look at tools such as Selenium IDE, WebDriver, Selenium Server, Java, JUnit, Maven, and IDEA.
We’ll take a look at a few details of Firebug and Firepath, the Selenium architecture, and categorizing the tools used in the Selenium suite.
What selenium IDE is, why to use it? Installation and setting up Selenium IDE. How to record and replay tests in Selenium IDE. Finding and locating elements in the page with Selenium IDE.
Assertion and verification with Selenium IDE. Playing/running/executing the entire test case in Selenium IDE.
Pros and cons of Selenium IDE. The difference between verify and assert. Modifying test scripts / test cases in Selenium IDE after recording. Exporting recorded steps/scripts to the desired programming language.
Exploit the flexibility of Selenium WebDriver such as many programming languages, different browsers, OS, and so on; test repeat and iteration, W3C draft, Java, JUnit, and Maven.
Demonstration of a basic Selenium example with Java and Maven.
WebDriver capabilities for different browsers such as Firefox, Chrome, IE, and so on.
Take a look at the WebDriver Java API.
Brief description of locating web elements by using ID, Name, Linktext, partialLinktext, xpath, css, and so on.
WebElements are returned using different locators. Learn how to use them effectively.
Writing Selenium test cases in a better, organized way using Page Objects Model or Page Objects Pattern.
Understand continuous integration and continuous delivery. Also go through Git for source code management.
Understand what Gherkin is and take a look at terms such as ‘Given’, ‘When’, and ‘Then’. Also understand the software requirements in the perspective of business.
Adding Maven dependencies cucumber-java and cucumber-junit on pom.xml Running Cucumber with JUnit Cucumber Runner.
Writing and implementing .feature files as plain text software requirement specifications. Implementing the Step Definitions class. Regular expression in the Cucumber test.
Know why better organized code helps in better maintenance of the project.
Understand Why, How, and When the Selenium Server is used.
Executing tests internally, running nodes on the hub. Running tests externally, such as on SauceLabs.
Running tests externally such as on SauceLabs.
A Complete Example
Step into the setup and implementation of the project environment. Learn how to make the Git repository.
Adding content in the feature file, making a JUnit Cucumber Runner, and creating and adding snippets in the step definition file.
What is CI? Download, install, and meet Jenkins in the browser at the port 8080.
UI testing with Cucumber and Selenium. Modify pom.xml for Cucumber and Selenium. Implement page objects for a small web app.
Implementing Tests for the Web Application
Some common advanced usage of Selenium is Explicit Waits, taking a screenshot, and advanced user interactions, mainly keyboard and mouse. Practical experience includes semantic verification, performing an actual transaction, for example, purchase, automation of service manager, and creating and adding user automatically.
Take a look at everything that was covered throughout the course and at channels to gain more knowledge.