Selenium Basics
Selenium Basics
What is selenium ? how its work ?what is basic features of selenium ?why we use selenium?
Selenium is not a tool is available in library(jar is kind of library and we use this jar)under this jars there
is number of methods classes are given to us, among this we have one interface called as "webdriver
interface" and what interface to it is used to define some rules(means only method declaration there is
no method body)there is different drivers are available for different browsers and this are in form of
classes,so all these different classes are implementing webdriver interface.so what will they do they
implement the method define in the webdriver interface according to there business logic.so they
override the all method in webdriver
How to use?1. I create a main method 2. I need a driver so I create a object of webdriver but we can'nt
create a object of webdriver 3.so to access webdriver we will use topcasting webdriver driver = new
chromedriver();
1 we create a reference of webdriver interface and point to this to chromedriver object so we can access
chromedriver
To create selenium project -go to file > new >project >maven project >and create one maven project
src/main/java- its used to design some core features mean any kind of utility-page classes,libraries we
write under main java
SID
1.webdriver dr = new Browser
chromedriver();
Its act like server
2.louch google .com
chromedriver
3.get.title
Script
4.Quit
5.again –get.title
Session 3
Locator Concept
With the help of different locators we can create a web element. ---
Find element is an method and By is an class here its gives u webelement referance so we can store it
into web element
Find.element is giving us a web element so we create a reference of it and create a weblement
Second method is Reusable we can use whenever we needed
2.locator –Name
3.locator-xpath
Locator-Css
Locator – class
Locator-link text
Locator- Partial link text
Locator Tag
3rd method we are actually using for locators