Home » selenium-tutorial (Page 3)

Category Archives: selenium-tutorial

Newly Updated Posts

Types of Testing Automation Framework

Previous Topic, Test automation Framework provides set of rules for handling data, maintaining object repository and executing test scripts in a proper formal structure. In this tutorial we will learn types of Testing Automation Framework in details.
The guidelines when followed gives a long term benefit like Code-Re usability, easy maintenance, improved test efficiency and maximum test coverage.

Note: These rules are not mandatory but on skipping the defined and well structured framework, benefits also get lost.

Types of Testing Automation Framework

There are basically 4 types of Testing Automation Framework that differs from one another from their architectural point of view with their advantages and disadvantage. So its very important to choose a framework wisely as per the requirement, these frameworks are as below.

  1. Linear Framework
  2. Modular Testing Framework
  3. Data Driven Framework
  4. Keyword Framework
  5. Hybrid Framework
  6. Behaviour Driven Development Framework

Lets consider their details:

1) Linear Framework:   It is basic level test automation framework which is in the form of ‘Record and Playback’ in a linear fashion. Tester manually executes the application and the tools record the steps of manual execution, capturing it attributes along the value with its test data(manually filled). Once the record is done and terminated by the tester, the recorded script can be executed & is used for testing.

  When to use Linear Framework?

  Answer→ Linear Framework is used when we need to test a complete flow with single test data(Parameterization of test data not required). As it requires no coding skill sets with no customised records(ex : logs, report, integration with other tool).

Advantages of Liner Framework:

  • Easy to create script
  • No coding skills are required
  • Easy to learn(as its have restricted features)

Disadvantages of Linear Framework:

  • No reusable functions
  • Not easy to maintain
  • Cannot execute the scripts with multiple sets of data.

Note: Linear framework is out from market now, its never used further as a part of framework.

2) Modular Testing Framework: In this framework, the application under test(AUT) is divided in to multiple modules and each module are further divided in to small scripts which are independent to each other. These individual test scripts are combined to create a large script which further fulfill the requirement of execution on defined scenario.

Structure of Modular Testing Framework

Advantages of Liner Framework:

  • If any change comes to an application only a particular module is being changed
  • Scalable
  • Easy maintenance of code due to modular structure

Disadvantages of Linear Framework:

  • Due to embedded test data in test script, creates problem while updating the code

3) Data Driven Framework:In this framework ,the test data and test logic are placed in different file. The test data is usually kept external from the script in the form of  CSV, Excel, ODBC etc. Functions/methods are made generic & data is passed in the form of parameter to the method body.

Here scripts are executed with different sets of data provided on external test data sheet unlike in linear programming where we are bounded to use hard coded data defined in script

When to use Data Driven Framework?

Answer→  Data Driven framework comes in to picture when we want our scripts to run them on large sets of data with different combinations.

Structure of Data Driven Framework

Advantages of Data Driven Framework:

  • Same scenario can be tested with different set of data
  • Structured framework easy to understand

Disadvantages of Data Driven Framework:

  • Tester has to create different files for keeping the test data and test logic
  • Time consuming

4) Keyword Driven Framework: In this Framework, keywords are been created for the different generic actions to be performed in GUI, these keywords are kept at external file and not under the test logic. Under this framework the keyword, object repository and functions are associated to work properly.

The external sheet contains keyword along with test data and object details. Whenever any keyword is been called, it executes its process(created function), identify its object and provide data in the Test Data column

When to use Keyword Driven Framework?

Answer→ Keyword framework is a preferred when we have limited type of objects in our application & our test script consist of repeative action on those objects. Example in case of Siebel CRM application, we have limited type of control available.

Here we can create our own standard library of common components and extend reusability. Also by following  this framework we can can hide our scripts from user and write our script in abstract manner 

Diagram of Keyword Driven Framework

Advantages of Keyword Driven Framework:

  • Code reusability
  • Test designing can be done without AUT (application under test)
  • Save time for multiple test design

Disadvantages of Keyword Driven Framework:

  • Shilled tester is required with programming skills
  • initial Cost of scripting is high
  • Need to maintain multiple sheets for test creation.

5) Hybrid Framework:  This framework is a combination of one or more framework. As per the requirement we customise the framework & use the strength associated with different type of frameworks.  Most commonly hybrid framework is the combination of Keyword and Hybrid approach.

Here we can use data from different channels (xml, csv, database, etc) with process defined in a form of keywords. This helps a tester to easily create, maintain and execute the automation scripts which can be re used in longer run

When to use Hybrid Framework?

Answer→ Whenever we come with a requirement to parameterise the test case with multiple sets of test data and have lot of repetitive steps called in every or most of the test cases, along with frequent execution, Hybrid framework comes in to picture. This type of framework has almost captured the market and in use mostly used.

Architecture of Hybrid Framework

6) Behaviour Driven Development Framework: This framework helps in active participation of (Business Analyst, Developer, Tester). It does not require user to be highly skilled programmer, user just need natural language to create test scripts. There are few tools available in market like cucumber, jBehave , etc.

Advantages of Data Driven Framework:

  • Easy to create test script.
  • No need to have programming skills.

Disadvantages of Data Driven Framework:

  • Need to have understanding of BDD structure and syntax.

How to Download & Install Java JDK 8 in window

In this tutorial we will learn how to Download & Install Java JDK 8 in window?

Step 1: Download java and setup java

How to Download & Install Java JDK 8 in window

  • Now Accept the Licence Agreement, always remember to choose correct JDK as per OS (Window, Mac, Linux)
How to Download & Install Java JDK 8 in window
  • On click to JDK .exe file,It will start downloading at the bottom(refer screenshot) below
Install java jdk 8

  • Now double click to jdk .exe file . The installation will start and click to next button
install java jdk

  • Installation will start with status of download
setup java jdk kit in window

  • Once the installation is completed. A last window of installer will open click to Close.

How to Download & Install Java JDK 8 in window
  • Now the next step is to install Java path on environment variable

Step->Right click to My computer-> properties->Select Advanced system settings->Click to Environment Variables at the bottom

setup environmental variable for java jdk in window
  • Under Environment Variable window->Under System variable->Select Path from Grid and click to Edit button(Refer Screenshot)
setup environmental variable for java jdk in window

  • Under Edit Environement window, Click to new button and add the java path till bin. Suppose you have Installed JDK in path->c:\Program Files\java\jdk1.8.0_77\bin

So in this case provide the jdk path till bin folder and click to OK button(Refer screenshot)

setup JDK path in environmental variable

  • Now Verify Java Installation

Open Command Prompt and enter java -version and click Enter(Refer Screen shot)

check jdk version from command prompt

So following the below steps we have learned how to Download & Install Java JDK 8 in window.

Why Selenium?

Why to use selenium webdriver

Selenium: is an (open source) web based automation tool. Selenium has the capability to integrate with different other tool and come up with a complete package.

Why to use selenium webdriver?

Selenium provides a list of platform and browser support these are:

  • Google Chrome
  • Safari
  • Firefox
  • IE
  • Phantom JS (Headless browser)
  • Html Unit (Headless browser) etc

Why to use selenium webdriver when we have multiple tools in market?

  1. Open Source: The advantage of using selenium oven other tools is its open source, so we do not have to pay a huge cost on purchase of heavy license and easily accessible.The developers of selenium keeps on providing the updates and versions with new functionality.              Due to refined methods and classes available in selenium it become easy in managing the code and integrating with third party tool.
  2. Platform Independent: Selenium is platform independent, so a single piece of code can be executed on different platform and execution is performed in same behaviour .
  3. Multi Browser Testing: Multiple browsing testing can be performed easily in selenium, we can run same code on different browsers like google chrome, firefox, safari, IE etc without any change in code.
  4. Integration with other tools: Due to easy integration with third party tool, selenium is much preferred for web automation than other tools in market. It is easy integrated with browserstack, saucelab, reporting tools like Extend report, etc.
  5. Easy to setup: Selenium is easy to setup in local system as compared to other tool which required heavy hardware installation and framework. In selenium we just need to add the provided jar to get started in any of preferred IDE (ex eclipse).

What is Automation Testing?

Automation Testing is a Software testing technique where the tester writes the test cases with help of automation tool and executes the test cases to check the flow of an application with it actual and expected result. Automated test execution reduces the manual effort for execution of repetitive test case.

Test Automation is one of the most cost-effective and time-saving methods to test software products with long maintenance cycles.

Whats the difference in manual and automation approach?

Parameter Manual Testing Automated Testing
Accuracy Less accurate and cannot perform repeated tasks Highly reliable for repeated tasks as it uses tools and scripts
Time Time taking Fast
Testing Highly effective as it involve human intervention Not so effective since there is no human intervention
Cost Require human effort Require software tool
Requirement Execution is performed once or twice Execution is performed repeatedly
Initial cost Very less It is high
Technical Skills Need functional resource Required skilled resource

Whats is the life cycle of Automation Process:

  • Test Tool Selection-> Selection of tool is performed as per the requirement of project in an organization.Suppose for a desktop application we cannot use automation tool which perform web based automation ex: Selenium etc.
  • Define Scope of Automation->Automation scope must be defined on the basis of complexity of test cases, amount of data for automation, application feasibility etc.
  • Planning, Design and Development-> In this phase we require proper understanding designing tool, scope in automation , automation tool, and timelines.
  • Test Execution->During this phase execution of test cases are being performed, during execution automation rides the application and generates the report with status.
  • Maintenance->As there is always new functionality being added at every iterations on an application, so being as tester the new test cases are being added for the new functionality and maintained with changes performed in an application.

Which tools are most effective in market?

  • Selenium
  • QTP
  • Appium
  • Jmeter
  • Appium
  • Zephyr
  • Sikuli