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.
- [Instructor] Welcome to the last video in this section. In the previous video, we discussed a few of the tools and plugins we'll use throughout this course. The key to getting up to speed with automating web pages is to precisely know how to access those elements in the DOM programmatically. Two of the tools that come in handy here are Firebug and Firepath. In this video, we'll take a look at Firebug and Firepath in detail.
Firebug is a Firefox plugin. It will make our life easier when we examine the web pages we will automate. Finding the ID or name of an element that you want to interact with is a lot easier with Firebug compared to most other tools I have tested. Firepath is a Firebug plugin that will help us find the XPath, as well as the CSS selector to an element we want to interact with. With these tools installed, let me show you a small example of what we can use them for.
Let's search for Selenium on Google in two of our favorite browsers, Chrome and Firefox. We will run the example from the command line using webin. Before execution, let's meet IntelliJ IDEA, a well known Java editor, with our example source code. This is an example from the Maven project. We won't go into a detailed code analysis here, the main purpose here is to run the code from the command prompt.
Pom.xml will manage the beat by providing the necessary dependencies. There are two dependencies. One is selenium-java, and the other is junit. The name of the Java class file is GoogleSearch_FF_ChromeTest. The Java class file has two methods. One for Firefox and the other for Google Chrome.
The meta testFirefox will run the Firefox browser. And the meta testChrome will run the Chrome browser. Now is the time to run the program from the command line. Let's go to the Chrome command line for executing the test script. Now let's go to the project folder and execute the Maven command, maven clean test.
There you go. Our test ran successfully. This is what it's all about, automating the execution of a browser. Now that we have seen what it's all about, let us look briefly at the architecture. A browser receives the command from a script. The commands are executed, and the result is reported back to the caller. The caller can be either Selenium IDE, or a programming language. The result can be verified with a verification framework.
We will be using JUnit in this course. Selenium is a set of tools that helps you automate web applications. You automate the browser to interact with the application, in effect, simulating an actual user's interaction with your system. You can control and drive different browsers and therefore, do cross-browser testing, and test the same application with Firefox, Chrome, Internet Explorer, Safari or Opera.
It is also possible to test web applications for Android and iPhone. The rest of this course will dive deeper into all the details of the different tools, and we will see them in action. That's all for this section. Phew! We've covered quite a lot. Let's see the overview of the entire course, and the tools and frameworks that will help us to master Selenium. In the next section, we will continue with the Selenium IDE, a Firefox plugin that will allow you to record and replay a user's journey through a web application.
Selenium gives developers the power to control web browsers and use them to automate web application testing. As an open-source 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 suite. 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.
Author Ripon Al Wasim starts with the 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 allows you to locate the elements you need to interact with using their name: id, xPath, or CSS. Next, learn to express the desired behavior using a well-known framework for behavior-driven development (BDD) called Cucumber for Java, which uses a language called Gherkin. Last but not least, Ripon shows how to run tests on the Selenium Server, and walks through a complete working example of Selenium and Cucumber in action, for acceptance testing of a web application.
- Preparing your Selenium test environment
- Using the Selenium IDE
- Scripting in WebDriver
- Locating web elements
- Writing test cases with the Page Object Model
- Enabling continuous delivery with a continuous integration build system
- Working with Cucumber and Gherkin
- Describing features with Cucumber
- Running tests on Selenium Server