From the course: Advanced Selenium: Automation Frameworks

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Introducing JUnit

Introducing JUnit

- Hi, so let's go ahead and talk about JUnit for a bit. JUnit is Java's most popular unit testing framework. It actually is the most included library in all of the Java projects on GitHub. Let's go ahead and take a look at JUnit in the IDE. On the left side of the screen, in IntelliJ, you'll see the project pane. In the project pane, open the source directory, abbreviated SRC, and then you should see a test directory. Open the test directory and underneath there's a Java package, right click on it. And we're going to create a new package to keep our tests in. There we go. And then on that package we've created, go ahead and right click and inside of that we're going to create a new Java class. We're going to name our class, Selenium test. So, by default, JUnit will actually run all of the classes it finds in this test directory here. We tend to use class names ending in test just as a sort of convention when we're doing…

Contents