Time for action – setting up Intellij IDEA project - Selenium

We will be setting up using JUnit as the testing framework to drive our tests.

  1. Open IDEA and create a new project.

  2. Create a directory at the root of the project called test using New | Directory.

  3. Click on File | Project structure.

  4. Click on Modules on the left-hand side of the dialog that has loaded.

  5. Click on the test folder that you created in the folder tree on the right-hand side of the dialog.

  6. Click on the Test Sources button and the test folder should turn green. It will look like the following screenshot:

  7. Click on File | Project structure.

  8. Click on Global libraries.

  9. Click on the + to add a New Global library. And then select Java.

  10. Click onAttach Classes and add selenium.jar and common.jar.This should be in the same place as your Selenium-Server.jar.When added,it should look like the following screenshot

  11. Do the same for JUnit now. You can create a new Globallibrary for it or add it to theSelenium Global Library.

  12. Click on the Modules link on the left-hand side again.

  13. Click on the Dependencies tab.

  14. Click on Add and click on Global Libraries. Add the Selenium and JUnit libraries.

  15. Click on Apply. When this is done the text selenium should turn purple.

  16. We are now ready to run Selenium Server. We do this by running java-jar selenium-server.jar from a command prompt or from a terminal depending on your operating system.

Your project is ready to have tests added to it. Each of the files that we create from now on will be placed in the test directory and will be run when we need to.

What just happened?

We have successfully set up a project to Selenium WebDriver.When we are working through all of the chapters going forward we will know that they will have all the aspects needed.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Selenium Topics