**Selenium Features**
· Selenium is open Source Automation Testing tool
· It is exclusively for Web Based applications.
· Selenium supports multiple browsers -Chrome, Firefox, Internet Explorer, Safari
· Selenium works with Multiple Platforms -Windows, Apple OS X, Linux
· Selenium can be coded in multiple languages - Java, C#, Python, Javascript, Python, php,Ruby
· Difference between Selenium and Webdriver?
Selenium WebDriver Architectue Simplified:
· After you trigger the Test, complete Selenium code (Client) which we have written will be converted to Json format
· Generated Json is sent to Browser Driver (Server) through http Protocol
Note: Each browser contains a separate browser driver
· . Browser drivers communicate with its respective browser and executes the commands by interpreting Json which It received on the browser.
· Browser Driver receives responses back from the browser and it sends Json response back to Client.
1.chrome Webdriver
package com.abc;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class a {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver","C:\\Users\\Genius\\Downloads\\Java Suite\\chromedriver_win32\\chromedriver.exe");
WebDriver driver=new ChromeDriver();//class
driver.get("https://rahulshettyacademy.com");
driver.getTitle();
System.out.println(driver.getTitle());
//driver.getCurrentUrl();
System.out.println(driver.getCurrentUrl());
//driver.close();
driver.quit();
}
}
2.Firefox Webdriver
package com.abc;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class a {
public static void main(String[] args) {
System.setProperty("webdriver.gecko.driver","C:\\Users\\Genius\\Downloads\\Java Suite\\geckodriver-v0.30.0-win64\\geckodriver.exe");
WebDriver driver=new FirefoxDriver();//class
driver.get("https://rahulshettyacademy.com");
driver.getTitle();
System.out.println(driver.getTitle());
//driver.getCurrentUrl();
System.out.println(driver.getCurrentUrl());
//driver.close();
//driver.quit();
}
}
3.Edge Webdriver
package com.abc;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.edge.EdgeDriver;
public class a {
public static void main(String[] args) {
System.setProperty("webdriver.edge.driver","C:\\Users\\Genius\\Downloads\\Java Suite\\edgedriver_win64\\msedgedriver.exe");
WebDriver driver =new EdgeDriver();
driver.get("https://rahulshettyacademy.com");
driver.getTitle();
System.out.println(driver.getTitle());
driver.getCurrentUrl();
System.out.println(driver.getCurrentUrl());
//driver.close();
//driver.quit();
}
}