Friday, August 3, 2018

Introduction to Selenium

Hi, guys welcome to easy learn. Here we are going to learn about Selenium tool which most widely and commonly used in software testing.

Before we going to start about the actual topic. We look at those points why we need selenium tool in software testing domain.


 Why we need Selenium in software testing?

  Only two simple reason 
  1. Its free and open source tool.
  2. It will reduce the rework and time of a test engineer.
 Next big question we have to answer is what is selenium.

What is Selenium?

Selenium is an Open source software testing tool mainly used for web application testing. it can be used in all platform (i.e Linux, Windows etc). It supports popular language to write test script such as Java, C#, Python, Ruby etc. 

Selenium was developed by Jason Huggins in 2004 as internal software for Thought Work, which is a privately owned software company.

Different flavors of selenium are:

  • Selenium core.
  • Selenium IDE.
  • Selenium RC also known as Selenium 1.
  • Selenium web driver, it is also known as Selenium 2. 
Latest Selenium Version is 3.13.0. which was released on 26/6/2018.



There are lots of web application automation tool available such as QTP, Test Complete etc. Then a question arises in our mind that "Why lots of companies and people prefer Selenium over others tools?" answer to that question is below.

Advantages of Selenium 

  • It is an open source tool.
  • It is free of cost (where QTP is a commercial tool).
  • It is supported for all type of browser (i.e Chrome, Firefox, etc).
  • It supports a large range of language for scripting (Python, Java, etc).
  • It supports Mobile web application for testing.
  • It integrates with a different type of framework such as TestNG (We will discuss the TestNG framework in upcoming Blogs.)
  • It is easy to implement.
  
I think now we all know what is selenium and why is used in software testing and what is the advantage of selenium.

Now we will discuss how to install the Selenium or set up selenium in our personal computer.


Note: Eclipse and java should be installed before installing the selenium.

If you have not installed java yet, Here is the link to download  Click here.

For Eclipse here is the link to download Click here.


Step 1: Create a folder in your computer.

Step 2: Open the Eclipse, Click on "Browse" button in the Eclipse launcher.

Step 3: Select the newly created folder as the new workspace, It will restart the eclipse.

Step 4: Create the New java project in eclipse with any name. 

Step 5: Download the selenium server standalone jar file from here. 


Click on Version to download.
Step 6: Copy the downloaded selenium standalone jar file.

Step 7: Paste in Java project you have created in eclipse.

Step 8: Right-click on selenium jar file which is present inside the java project. Go to build path and  Click on "Add to build path".

Adding selenium jar file to build path.




Step 9: Now we have to download the browser executable files which are developed by third-party Click here go to the website.

Step 10: Scroll down and click on any browser name to download their executable files. (here we will be using Google Chrome browser, So click on Google Chrome Driver) 

Click on Google Chrome Driver

Step 11: Click on ChromeDriver 2.41.



Click on Chrome Driver 2.41

Step 12: Click on zip file based on your operating system.


Click on chromedriver_win32.zip.
Step 13: Zip file will be downloaded, Go to downloads in the computer and extract the file you will get an executable file.

chromedriver.exe file

Step 14: Now create a file in the java project by right-clicking on it, Give folder name as a driver.

Step 15: Copy the "chromedriver.exe" file to "driver" folder in the java project. 


Now we all set to write the test script and execute it. This is all about Introduction to selenium and installing or setting up the selenium tool in the eclipse.

In the next blog, We will write the simple test script also we will learn about Architecture of Selenium and Webdriver.




No comments:

Post a Comment