Introduction of Selenium Webdriver Using Java
What is Selenium? Selenium is used for automating web applications for testing purposes. It is a suite of tools to automate browsers across many platforms. This is a stand alone tool. Selenium has the following tools : Selenium IDE Selenium RC Selenium Grid Selenium WebDriver
Selenium Webdriver Open Source Software Supports Different Operating Environments Windows, Linux, Mac Supports Different languages like Java, C#, Ruby, Python, Javascript Supports cross browser testing like Firefox, Chrome, IE, Safari
Tools needed to Run Selenium Java 8 Intellij Firebug Firepath Maven Junit
Java 8 Make sure to set the Environment variables for JAVA_HOME Also set the path variable to for Java bin location
Firebug and Firepath Firebug and Firepath are the tools that integrate with firefox. These both helps to inspect the web elements and generate the Xpath.
Maven Install Maven software from https://maven.apache.org/download.cgi Unzip the software and specific the location in path variable
Junit Junit is test framework for Java programming language. Annotations in Junit: After Before AfterClass BeforeClass @Test Ignore
JavaDoc Classes needed to write a basic selenium code WebDriver WebElement By
By Class By.ByClassName, By.ByCssSelector, By.ById, By.ByLinkText, By.ByName, By.ByPartialLinkText, By.ByTagName, By.ByXPath,
Xpath Xpath is a syntax or language to find the web elements in a web page. Absolute Xpath Relative Xpath
Xpath //tagname[@attribute-name = ‘value’] Examples: //input[@name=‘login’] //input[@name=‘login][class=‘input’] //input[@name=‘login or class=‘input’] //input[@name=‘login and class=‘input’] //input[text()=‘hello’]