
Setup Selenium Java Project in Eclipse
Today we will learn...
1. What are the Prerequisites
2. How to create maven project in Eclipse
3. Add dependencies in pom.xml
4. Make project ready for adding Selenium scripts
You can follow this on...
Windows and Mac
Prerequisites
Java is installed on your system
Eclipse is installed on your system
Maven is installed on your system
REFERENCES :
Install Java on windows - https://www.youtube.com/watch?v=FqpmH8MVO6A
Install Java on Mac - https://www.youtube.com/watch?v=NSvtis2fGlA
Eclipse - Getting Started - https://www.youtube.com/watch?v=rpB1WWqZ6HQ
https://mvnrepository.com
http://www.seleniumhq.org
Today we will learn...
1. How to add Firefox browser driver - Geckodriver
2. Run a test on Firefox browser
To add gecko driver exe
System.setProperty("webdriver.gecko.driver",” path to gecko driver exe”);
OR
System.setProperty("webdriver.firefox.marionette", “path to gecko driver exe”);
You can follow this on...
Windows and Mac
References:
https://github.com/mozilla/geckodriver/releases
Today we will learn...
How to add Chrome Driver
Run a test on Chrome browser
Step 1 :
Download ChromeDriver
Step 2 :
Add ChromeDriver in Eclipse
Step 3 :
Add script in Eclipse (IDE)
System.setProperty("webdriver.chrome.driver",”location of chromedriver”);
Webdriver driver = new ChromeDriver();
Step 4 :
Run and Validate
helpful tips
Always check the latest version of chrome driver from
https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver
If you give the location of folder having driver in environment variable Path, then you don’t have to set
System.setProperty("webdriver.chrome.driver",”location of chromedriver”);
REFERENCES
https://chromedriver.storage.googleapis.com/index.html
https://www.seleniumhq.org/download/
http://chromedriver.chromium.org/downloads
https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver
How to run Selenium tests on Internet Explorer
Today we will learn
1. How to add IE Driver
2. Run a test on IE browser
Step 1 :
Download IEDriver
Step 2 :
Add IEDriver in Eclipse
Step 3 :
Add script in Eclipse (IDE)
System.setProperty("webdriver.ie.driver",”location of iedriver”);
Webdriver driver = new InternetExplorerDriver();
Step 4 :
Run and Validate
helpful tips
Always check the latest version of ie driver from
https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver
If you give the location of folder having driver in environment variable Path, then you don’t have to set
System.setProperty("webdriver.ie.driver",”location of iedriver”);
REFERENCES
https://www.seleniumhq.org/download/
https://selenium-release.storage.googleapis.com/index.html
https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver
How to find Web Elements Locators in Selenium
Today we will learn...
1. How to find web elements
2. How to use Selenium functions to locate elements
helpful
tips
Step 1 :
Inspect Web Element
Step 2 :
Check any of these locators
id
name
cssSelector
xPath
className
linkText
partialLinkText
tagName
Step 3 :
Use locators with Selenium func.
findElement
findElements
helpful
tips
Check your selected locator in different browsers
Can take help of tools for generating xpath and cssSelectors
Can ask developers to provide unique ids to every web element for easy identification and location
REFERENCES
https://www.w3schools.com/xml/xpath_examples.asp
http://xmltoolbox.appspot.com/xpath_generator.html
https://www.youtube.com/watch?v=8V74PsFupis
https://www.youtube.com/watch?v=ft52GxN7SPw
How to create FIRST SELENIUM TEST in Java
Today we will learn...
1.How to create a test in Selenium
2.Run and Validate
Step 1 :
Create a Java Class
Step 2 :
Add code to open browser
Step 3 :
Add code for browser actions
Step 4 :
Close Browser
Step 5 :
Run and Validate
helpful tips
Check your selected locator in different browsers
Can take help of tools for generating xpath and cssSelectors
Whenever you face any error:
Check the logs
Copy the error on Google and search
What is Page Object Model (POM) | How to create POM in Selenium
Today we will learn...
1. What is POM - Page Object Model
2. How to implement POM
What is POM
===========
Design Principle
Create separate Object Repository to store object locators
For each web page there should be a separate page class
The page class will have all object locators and preferably action methods for the corresponding page
Step 1 :
Create a class for each web page
Step 2 :
Add object locators
Step 3 :
Create class for test
Step 4 :
Refer objects from page classes
Step 5 :
Run and validate
Benefits of POM
=============
Test Objects and Functions are separated for easy maintenance and keeping the code clean
Objects are kept separated from test scripts and can be used multiple times in multiple tests
Every unique object locator is created only once
Easy Maintenance and Less Rework
This course if for complete Beginners.
You can take this course without any prior knowledge on Selenium, Java or Automation.
We will go very basic, Step-by-Step and learn - How to create a Selenium Java Framework
In this course we will learn:
How to setup a Selenium Java Project from scratch
How to create Selenium Java scripts
How to run tests on different browsers - Chrome, Firefox, IE
How to find Web Locators
How to setup Page Object Model - POM
How to use TestNG
How to use Extent Reports
How to create Data Driven tests using Excel file
How to do Logging
How to do Exception Handling
How to run tests on Headless Browser
and much much more...
Let's Get Started...