Grow Together Mentors Inspire Us In Life

Internet

Powered by Blogger.

Technology

Gadgets

Latest Release

Wednesday, 27 May 2015


package com.example;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;

public class Learning {
 // Commands for open Firefox browser
 WebDriver driver = new FirefoxDriver();

 @BeforeTest
 public void setUp() {
  // To open mentioned URL in Firefox browser
  driver.get("http://allabtselenium.blogspot.in/");
 }

 @AfterTest
 public void tearDown() {

  driver.close();
 }

}

Sunday, 9 February 2014


The Potential Differences Between HP QTP & Selenium 
The IT sector is aware of the emergence of QuickTest Professional (QTP) & Selenium as the popular choice of testers & programmers for their test automation effort.
First of all let us have a quick overview of both the software testing tools, before going into a broad comparison among the functionality of the two.
1) Quick Overview – HP QTP:
QTPis automated testing tool meant for performing functional and regression testing of various software applications and environments through a user interface like native GUI or web interface. It uses VBScript as the scripting language for specifying a test procedure, & for manipulating the objects & controls of the AUT. It supports a keyword and a powerful graphical user interface.
2) Quick Overview – Selenium:
Selenium is an open source software-testing tool that had been developed by Jason Huggins & his team This is released under the Apache 2.0 license and can be downloaded and used without any charge. It provides a record / playback function for authoring the tests meant for web applications. It offers a test domain specific language (DSL) to write tests in many popular languages like C#, Java, Groovy, Perl, PHP, Python and Ruby etc. Selenium works on Windows, Linux, and Macintosh platforms. Many additional projects have emerged out of the parent Selenium like Selenium Grid Selenium IDE & Selenium Remote Control having different abilities that provide a boost to the parent Selenium.
Now let us make a broad comparison among the two tools
Sr.What HP QTP hasWhat Selenium has
1QTP is ideally suited for browser based testingSelenium too can very well do browser based testing
2QTP is licensed software & requires license costs that are quite a bit.Selenium is an open source tool that doesn’t cost anything
3QTP is quite easy to use. It is quite easy to edit the script, parameterize, navigate, playback & validate the results.For using Selenium one needs to have programming skills.
4QTP is quite easy to learn in a short time.Selenium needs quite a bit of expertise compared to QTP.
5QTP offers great benefit of the support for Business Process Testing.Selenium users don’t enjoy such benefits
6QTP comes powered with several add-ins by which user can comfortably work with Web, Windows, Java, dotNet applications simultaneously.Selenium users don’t enjoy such facility.
7QTP seamlessly integrates with QC and has excellent ability to automate non-web applications.Selenium is an excellent tool for purely web-based applications, especially when you don’t need QC.
8QTP works very well with database applications better than Selenium.With Selenium one needs to exert hard to do the same job.
9It is difficult to deploy smoke tests for web applications using QTP especially with Windows7.With Selenium these tasks can be easily accomplished.
10QTP uses VBscript as the only scripting languageSelenium provides a test domain specific language (DSL) to write tests in many popular programming languages, in addition to scripting with VB script
11QTP users find scripts written in VBscript more flexible & easy to manipulate & as such tool tends to be cost effective due to the availability of a full fledged support.Selenium users feel that the tool tends to be expensive due to lack of support & necessity of rewriting its scripts quite often
12Resource wise it is quite easy to find engineers having expertise on QTPSelenium Automation Engineer are bit scarce.
13With QTP we can easily generate most comprehensive reports due to the availability of an efficient online helpSelenium users don’t enjoy such luxury as enjoyed by QTP users
14Using a QTP framework needs less skills & everyone from a beginner to an expert can contribute in test creation to maintenanceSkill level expected in a Selenium Automation Engineer are a bit higher compared to QTP Automation Engineer
15QTP users don’t enjoy a freedom of scripting language & IDE like their counterparts using Selenium.For web based applications, development with Selenium is a wonderful experience since developer gets two benefits like;1) Scripting language of own choice2) IDE of Own choice.
16QTP is one of the best automation testing tool due to its unique features like Object Repositories, Object identification, Smart Identification etc in addition to its unmatched strength in database testing.Selenium certainly lacks such features packed in QTP.
Conclusion:
Our objective had not been to favor one at the cost of the second. It is a matter of convenience for the testers & programmers to select a tool that suits their requirements best.
Lastly both these tools have their own advantages & shortcomings, while it all depends upon the users who truly knows how to exploit them to their best advantage.
QTP: -
Functional Testing Tool -QTP has the feature for storing screenshot of each and every page navigated during the execution. So it can be used as a proof for completion of testing, and also we can refer the screenshots of previous executions if there is any need to refer them. Test report can be automatically written to a customized report page which will ensure accuracy of the report and also it can improve look & feel of the report

Advantages of Using QTP

§User friendliness and less effort for script creation.
§Meets the needs of both technical and non-technical users.
§Advanced solution for functional test and regression test automation.
§Automation scripts are executed within specific interval of time using task scheduler/crone job.
§Many inbuilt functionalities by default and easy configuration.
§Excellent Object Identification process/mechanism.
§Easily integrated with test management tools like QC.

Disadvantages of QTP
In recent economic crisis, software companies are planning for cost reduction and efficient productivity. QTP is losing its market because of the following limitations:

§Runs only in Windows environments.
§Cannot test with all browser types and versions.
§Limited to smaller organizations/ testing teams.
§High licensing and add-inns costs.
§Slow in execution when compared with open source tools.

Selenium: -There are four variants of Selenium, which can be used in isolation or in combination to create complete automation suite for your web applications.

§Selenium IDE – Recording/Creating and enhancing scripts
§Selenium Remote Control (RC)– Executing scripts
§Selenium Web Driver (API) – Cross browser testing
§Selenium Grid – Cross platform testing

Advantages of Using Selenium:-

§Simple and powerful document object model (DOM) level testing, can be used for continuous integration with agile projects.
§Has great extensibility and flexibility, along with its tight integration with the browser unmatched by   available proprietary tools.
§Supports multiple browsers such as Internet Explorer, Fire fox, Safari or Opera on Windows, Mac OS X and Linux.
§Wires Object Oriented Programming languages like JAVA, .NET, Ruby, Perl, PHP, etc.
§Provides the option of using wide range of IDEs such as Eclipse, Netbeans, Visual Studio etc depending on  the choice of development language.

Disadvantages of Selenium: -

§Supports only browser based application, not the windows application
§Does not support file uploads from local machine
§Provides only partial support for dialog boxes
§Being an open source, Selenium has no official technical support 

Comparison between Selenium and QTP is as follows:-


                FEATURES

              SELENIUM

                QTP

Cost

Open source & Portable

Licensed and very expensive; Ten user license costs approx. 60L

Application support

Web Applications only

Client server applications only (like built in TCL/TK and PowerBuilder)

Support for web browsers

Supports IE, Firefox, Safari and Opera

Supports IE & Firefox only

Object Oriented Language support & Scalability

Supports Java, .Net, Perl, PHP, Python, and Ruby

Supports VB script only

Support for operating system/platforms

Supports Windows PC/MAC/UNIX Platforms

Supports Windows Platform only

Support for Test management tool integration

Not available. Need to track separately

TD/QC will be easily integrated

Test Development Environment

We can use wide range of IDEs like Eclipse, Netbeans, Visual Studio etc

Need Separate environment

UI object management & Storage

Managed using UI-Element user extension and properties A set of dynamically loaded libraries that is stored in the Java archive file.

Built-in object repository and easy handling

Support for Dialog Boxes

Supports partially

Supports all kinds of dialog boxes

Support for File upload (system)

Not available

Supports all kinds of File upload


Conclusion:-
· Using Selenium as the Functional Test Automation Tool, you can reduce the cost incurred for licensing using QTP.
· The efforts involved in scripting for Selenium increased by about 15 % than QTP in the initial stages. Once all the solutions are in place the efforts of automation using Selenium and QTP were almost the same.

Friday, 17 January 2014


Chapter 1: Selenium Introduction

  • Selenium Introduction
    • What is Selenium and Why Selenium
  • Selenium Components
  • Introduction of selenium Components
  • Java in Selenium?

Chapter 2: OOPs concepts and Core java Introduction

  • OOPs concepts
  • Setup Java environment – Download JDK and Setup eclipse
  • Java programming concepts
    • Class, Object ,variables, methods, Packages
    • Conditions and loops
    • Access and non-access modifiers
  • Advanced Java Programming
    • Interfaces, Inheritance
    • Collections, Exceptions

Chapter 3: Selenium IDE and RC Introduction

  • How Selenium IDE works
  • Installing Selenium IDE
  • “Selenese” – Selenium Commands
  • Actions, Asserts, Assesors
  • Developing Test Cases & Test Suites With Selenium-IDE
  • Introduction to Selenium RC

Chapter 4: Selenium WebDriver Introduction

  • Selenium WebDriver Introduction
  • WebDriver Vs RC
  • Download and Configure WebDriver with Eclipse
  • Simple Testcase
    • Open and Close Browser
    • Cross Browser Testing – Firefox, IE ,Chrome, HtmlUnitDriver
  • UI elements ,Locators
  • Identifying WebElement using id, name, link text, class, xpath, css
  • Handling various WebElement using WebDriver
  • Handling Mouse movements and keyboard Events

Chapter 5: Testing Framework and Tools

  • Introduction of Testing framework
  • Types of frameworks
  • Tools for developing Test Framework
  • TestNG introduction and Configuration with eclipse
  • TestNG Annotations and Data Providers
  • Creating Test Suit with TestNG

Chapter 6: Develop Hybrid Framework

  • Developing Hybrid Framework for Web Application using WebDriver /TestNG
  • Use external Data for Testing (Excel sheet , xml files, Property file )
  • Reading and understanding reports
  • Screenshots for failed Test case

Monday, 28 October 2013

  Selenium is a free (open source) automated testing suite for web applications across different browsers and platforms. It is quite similar to HP Quick Test Pro (QTP) only that Selenium focuses on automating web-based applications.
Selenium is not just a single tool but a suite of softwares, each catering to different testing needs of an organization.
 It has four components.
  • Selenium Integrated Development Environment (IDE)
  • Selenium Remote Control (RC)
  • WebDriver
  • Selenium Grid

At the moment, Selenium RC and WebDriver are merged into a single framework to form Selenium 2. Selenium 1, by the way, refers to Selenium RC. 
Who developed Selenium?


    Since Selenium is a collection of different tools, it had different developers as well. Below are the key persons who made notable contributions to the Selenium Project


Birth of Selenium Core
Primarily, Selenium was created by Jason Huggins in 2004. An engineer at ThoughtWorks, he was working on a web application that required frequent testing. Having realized that the repetitious manual testing of their application was becoming more and more inefficient, he created a JavaScript program that would automatically control the browser’s actions. He named this program as the “JavaScriptTestRunner.”
Seeing potential in this idea to help automate other web applications , he made JavaScriptRunner open-source which was later re-named as Selenium Core.


The Same Origin Policy Issue
    Same Origin policy prohibits JavaScript code from accessing elements from a domain that is different from where it was launched. Example, the HTML code in www.google.com uses a JavaScript program “randomScript.js”. The same origin policy will only allow randomScript.js to access pages within google.com such as google.com/mail, google.com/login, or google.com/signup. However, it cannot access pages from different sites such as yahoo.com/search or guru99.com because they belong to different domains.
    This is the reason why prior to Selenium RC, testers needed to install local copies of both Selenium Core (a JavaScript program) and the web server containing the web application being tested so they would belong to the same domain

Birth of Selenium Remote Control (Selenium RC)


Unfortunately; testers using Selenium Core had to install the whole application under test and the web server on their own local computers because of the restrictions imposed by the same origin policy. So another ThoughtWork’s engineer, Paul Hammant, decided to create a server that will act as an HTTP proxy to “trick” the browser into believing that Selenium Core and the web application being tested come from the same domain. This system became known as the Selenium Remote Control or Selenium 1.


Birth of Selenium Grid

Selenium Grid was developed by Patrick Lightbody to address the need of minimizing test execution times as much as possible. He initially called the system “Hosted QA.” It was capable of capturing browser screenshots during significant stages, and also of sending out Selenium commands to different machines simultaneously.




Birth of Selenium IDE

Shinya Kasatani of Japan created Selenium IDE, a Firefox extension that can automate the browser through a record-and-playback feature. He came up with this idea to further increase the speed in creating test cases. He donated Selenium IDE to the Selenium Project in 2006.




Birth of WebDriver


Simon Stewart created WebDriver circa 2006 when browsers and web applications were becoming more powerful and more restrictive with JavaScript programs like Selenium Core.It was the first cross-platform testing framework that could control the browser from the OS level.






Birth of Selenium 2

In 2008, the whole Selenium Team decided to merge WebDriver and Selenium RC to form a more powerful tool  called Selenium 2, with WebDriver being the core. Currently, Selenium RC is still being developed but only in maintenance mode. Most of the Selenium Project’s efforts are now focused on Selenium 2.

So, Why the Name Selenium?

It came from a joke which Jason cracked one time to his team. Another automated testing framework was popular during Selenium’s development, and it was by the company called Mercury Interactive (yes, the company who originally made QTP before it was acquired by HP). Since Selenium is a well-known antidote for Mercury poisoning, Jason suggested that name. His teammates took it, and so that is how we got to call this framework up to the present.