Selenium
What is Software Testing : Verifying application support customer business or not.
What is Automation Testing : Testing perform by using automation tool.
What is Automation Tool : It is software which is use to test another software.
Selenium Tool :
It is automation testing tool which is use to perform functionality testing on web application.
Advantages of selenium :
- Selenium tool is pure open source.
- Selenium supports multiple languages that include Java, Python, C#, Java Script.
- Selenium supports multiple operating systems like Windows, Linux, Unix etc.
- Selenium can be integrated with other automation tool.
- Compatibility Testing can be perform.
Disadvantages of selenium :
- Selenium script creation time is bit high.
- Selenium does not support file upload facility.
- Selenium supports only web based application.
- It is difficult to test Image based application.
Procedure to config selenium :
1) Install JDK
2)Setup system variables path up to JDK bin folder
3)Download eclipse and install
4)Create workspace folder in any drive
5)Open eclipse and switch workspace to created folder
6)Create a project within Src
7)Create a Package
8)Within Package create a Class
9)Download selenium Jar files
10)Within Java Project create a Folder
11)Copy selenium Jar file and paste
12) Select selenium Jar files
13)Right click select Build path and click on Add to Build Path
Example :
package browser_handling;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Script_1 {
public static void main(String[] args) throws InterruptedException {
FirefoxDriver driver = new FirefoxDriver();
Thread.sleep(3000);
driver.get("https://www.facebook.com");
Thread.sleep(3000);
driver.close();
}
}
- get() : This method is use to open browser.
- close() : This method is use to close browser.
- To open browser we need to create Browser class
Example: FirefoxDriver rv = new FirefoxDriver();
ChromeDriver rv = new ChromeDriver();