Selenium

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 :

  1. Selenium tool is pure open source.
  2. Selenium supports multiple languages that include Java, Python, C#, Java Script.
  3. Selenium supports multiple operating systems like Windows, Linux, Unix etc.
  4. Selenium can be integrated with other automation tool.
  5. Compatibility Testing can be perform.

Disadvantages of selenium :

  1. Selenium script creation time is bit high.
  2. Selenium does not support file upload facility.
  3. Selenium supports only web based application.
  4. 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();

Read more