From the course: Robot Framework Test Automation: Level 1 (Selenium)
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
Adding setup and tear down - Selenium Tutorial
From the course: Robot Framework Test Automation: Level 1 (Selenium)
Adding setup and tear down
In this video, we're going to utilize the Robot Framework setup and teardown mechanism, specifically test setup and test teardown, suite setup and teardown are also available, to allow you to do things before and after your entire suite runs. But for this example, I'm only going to use test setup and teardown. Why do we want to do this? Because then we don't have to specify in our test cases to open and close the browser, and we'll have one script block to easily handle any test related setup. The really important thing about utilizing test teardown is that the browser will close even if an exception occurs. What we discussed in a previous video was that the way things currently are, if one of our test steps fails, Robot Framework will skip the rest of the steps of that test case and the browser will never be closed. If we place it within a test teardown, that browser will always be closed. So how do we do it? First, we add the Selenium2Library to Common.robot, which we've already…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
Overview6m 51s
-
(Locked)
Preview of the final solution6m 9s
-
(Locked)
Style: Procedural vs. Gherkin3m 11s
-
(Locked)
Introducing user-defined keywords5m 20s
-
(Locked)
Break the script into keywords7m 18s
-
(Locked)
Moving keywords to resource files7m 47s
-
(Locked)
Adding setup and tear down5m 36s
-
(Locked)
Overview of page objects7m 47s
-
(Locked)
Demo: Create a page object4m 7s
-
(Locked)
Increase readability using Gherkin7m 43s
-
-
-
-
-
-
-