Here is the next part of my tutorial for web automation using Selenium. In this tutorial, I will show you my Driver and TestBase classes and the first simple and successful test run. Do not forget to go to my website at JGTechnologySolutions.com to check out my main web site.
Month: March 2016
Creating Controller Class
Make sure to read my Getting Started with Selenium blogpost to get set up to create automation tests. Then, watch the video below to Create a Controller class, which will interact with web elements on the web page.
Getting Started with Selenium
- Install Java SE Development Kit 8
- Click here to be taken to oracle.com
- Install IntelliJ 15
- Click here to be taken to jetbrains.com
- Launch IntelliJ 15
- Navigate through setting up your java environment (if first opened)
- Make sure to enable TestNG and Maven plugins
- Click Create New Project
- Create a Maven Project and Select Project SDK that was downloaded earlier then click next
- Enter GroupId, ArtifactId, and Version for your new project then click next
- Enter Project Name and Project directory then click finish
- ****Make sure to enable auto import maven projects******
- Paste the following dependencies tag to your pom.xml to use selenium in your web automation tests and TestNG capabilities. *wait until all processes finish*
<dependencies> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>2.52.0</version> </dependency> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>6.8</version> <scope>test</scope> </dependency> </dependencies>
- Now you have the basic for creating tests with selenium in IntelliJ using Java language. Make sure to watch my tutorials on how to create Drivers, Controllers, and a TestBase to create your first web automation test.