Tuesday, December 9, 2014

Testing is an essential part of a software development process. While testing intermediate versions of products/projects being developed, testing team needs to execute a number of test cases. In addition, prior to release every new version, it is mandatory that the version is passed through a set of “regression” and “smoke” tests. Most of all such tests are standard for every new version of product/project, and therefore can be automated in order to save human resources and time for executing them.

1. Selenium - Selenium is a well know open source testing framework, which is widely used for testing Web-based applications. It has different components and in that Webdriver has rendered the Selenium Remote Control obsolete, and is commonly referred to as Selenium 2.0.

Selenium Webdriver supports most of all browsers to run your test cases and many programming languages like C#, Java, Python, Ruby, .Net, Perl, PHP, etc.. to create and modify your test scripts.

2. Eclipse IDE: Eclipse is an integrated development environment (IDE) for Java. The Eclipse IDE is the most known product of the Eclipse Open Source project.

3. TestNG - Is a testing framework inspired from JUnit and NUnit. It has extended new functionalities which made it more powerful and easier than the other testing frameworks.

4. AutoIT - AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks which is not possible with selenium.

File Formats Used in the Framework:

Properties file – We use properties file to store and retrieve the UI elements of an application or a website and data set file paths. It contains id of the elements, name, xpath or Css selector etc.

Excel files – Excel files are used to pass multiple sets of data to the application.

Xml file – Is used to execute the test scripts. Based on the package or classes or Tests mentioned in the xml file scripts will be executed.

The following figure explains physical structure of files required for Test Automation Framework

The Project Folder Structure: All the basic required folders are created with the sub folders and classes under each folder:--

UIMap is a concept for defining, storing, and serving UI elements of an application or a website. The UIMap properties file contains a set of ‘key-value’ pairs, where key is an alias of the UI element, and a value is the locator. Click here for more..

Data set stores the data files, Script reads test data from external data sources and executes test based on it. Data sets increases test coverage by performing testing with various inputs and reduce the number of overall test scripts needed to implement all the test cases. Click here for more..

A test is considered as a single action or a sequence of actions, that defines whether a specific feature meets functional requirements. It has multiple test files / packages / class files which will be executed based on the configurations defined in testng.xml. Click here for more..

Test report/results is a document which contains summary of test activities. After execution is completed, it is very important to communicate the test results and findings to the project manager and with that decisions can be made for the release. Click here for More..

In order to create a test suite and run separate test cases, we need framework which drives the automation. Here testng.xml can be called as "driver" which drives several test cases automated using selenium code. Advantage of using TestNG with Selenium is of running multiple test cases from multiple classes using xml configuration file .Click here for More..