Friday, 13 February 2015

GETTING START WITH SELENIUM


WHAT IS SELENIUM?

        Selenium is a set of different software tools each with a different approach to supporting test automation. Most Selenium QA Engineers focus on the one or two tools that most meet the needs of their project, however learning all the tools will give you many different options for approaching different test automation problems. The entire suite of tools results in a rich set of testing functions specifically geared to the needs of testing of web applications of all types. These operations are highly flexible, allowing many options for locating UI elements and comparing expected test results against actual application behavior. One of Selenium’s key features is the support for executing one’s tests on multiple browser platforms.

WHY SELENIUM?

             Selenium makes testing the web application much easier and fast. Manual testing a web application is very complex and time consuming. Consider we are going to test Facebook. We can’t even imagine manually testing. In this scenario automated test is an important factor. Each time when a new build releases, we have to do the testing from the beginning. It’s not feasible do manual testing every time. There some situation which we can’t automate, such as in the case of an On Time Password (OTP). If the password is sent to the mobile, we can’t automate such scenario. Another situation is Captcha. We can’t write java code for capturing captcha. We can write if we want to. There is company researching in AI (Artificial Intelligence) actually break the captcha. Right now we are not interested in that, so let’s continue with Selenium.

HOW TO SETUP SELENIUM?

          Now I will tell you how to setup Selenium. For setting up we need two things. One is Eclipse IDE (Try to download the latest version as per my Knowledge Luna is the latest version). Next is Selenium JAR file, you can download the JAR file from the Oracle website. Download the Selenium Standalone version because it has all the file you need.


SETTING UP ECLIPSE

             Download the eclipse from the official website an install. Click here
Open the IDE and from the File->New-Java Project. Set the project name, give the path to project to save file then finish the wizard.
 
SETTING UP SELENIUM

            Download the Selenium Standalone from the below link and save. Click here

           Create a folder in the project folder named jar save the JAR File in the Jar folder. A JAR file is a type of compressed file, which is actually using the same compression algorithms and format as ZIP files. ZIP files are the most popular form of compressed file available.JAR files normally contain a number of Java Classes and some metadata (a manifest file). Java classes are part of applications which are written in Java, a popular programming language. Some are able to run in your browser (Java applets), and some are standalone Java applications for which you need a Java Runtime Environment to run.

        We are using Selenium Standalone JAR file. That contain class file useful for writing test case for the web application. So we are including the JAR file to our project since it’s created for web testing

HOW TO INCLUDE SELENIUM JAR IN THE PROJECT?

        To include the JAR file to the project follow these steps, Right click on the project that you have created select Properties->Java Build Path->Libraries-> Add External JARS then navigate to the folder where JAR file saved and click OK to finish.
    Now the JAR file is added to the project. Now you can start using the Selenium Library.

No comments:

Post a Comment