May 29, 2014

Introduction - Selenium

Topics going to see:

  1. GUI Testing
  2. Why we need web GUI automation tools ?
  3. What is Selenium?
  4. Why Selenium?
  5. Selenium types
  6. Selenium using python
  7. Sample GUI automation

GUI Testing

  1. UI testing ensures that your application returns the correct UI output in response to a sequence of user actions on a device, such as entering keyboard input or pressing toolbars, menus, dialogs, images, and other UI controls.

Why we need web GUI automation tools ?

  1. Manual GUI testing takes long time
  2. Once the test case is automated, its easy to do a testing again
  3. Scenarios may be missed sometimes
  4. Generating the reports
   
What is Selenium? 
  1. Selenium automates browsers
  2. It is a software testing framework for web applications

Why Selenium?

  1. Its Open source
  2. Its easy to learn and implement
  3. Supports multiple browsers
  4. Supports multiple scripting/programming languages - Flexible to your choice, simple record and playback (IDE), Compile Framework design to your choice by using your favorite programming language
  5. Supports parallel execution
 Selenium types
  1. Selenium IDE – Record & Play
  2. Selenium WebDriver – Program interface
  3. Selenium Grid – Parallel execution, Multi instance & Multi platform

Selenium WebDriver using python

  1. Selenium web driver provides multiple language support (PERL, Python, Java, C#, etc.)
  2. Easy to write a code

Sample GUI automation 

from selenium import webdriver 
browser = webdriver.Firefox() 
url = 'http://www.google.com' 
browser.get(url)
 
 

Sep 30, 2013

Unix Utility - AWK


AWK - Aho Weinberger Kernighan

AWK is an interpreted programming language designed for text processing and typically used as a data extraction and reporting tool. 

It is a standard feature of most Unix-like operating systems. AWK was very popular in the late 1970s and 1980s, but from the 1990s has largely been replaced by Perl, on which AWK had a strong influence.

Some of the key features of Awk are: 
  • Awk views a text file as records and fields.
  • Like common programming language, Awk has variables, conditionals and loops.
  • Awk has arithmetic and string operators.
  • Awk can generate formatted reports
Awk reads from a file or from its standard input, and outputs to its standard output. Awk does not get along with non-text files.

Syntax:

awk '/search pattern1/ {Actions}
     /search pattern2/ {Actions}' file
 
In the above awk syntax:
  • search pattern is a regular expression.
  • Actions – statement(s) to be performed.
  • several patterns and actions are possible in Awk.
  • file – Input file.
  • Single quotes around program is to avoid shell not to interpret any of its special characters. 
Example:
 
$ cat employees.txt
100  Thomas  Manager    Sales       $5,000
200  Jason   Developer  Technology  $5,500
300  Sanjay  Sysadmin   Technology  $7,000
400  Nisha   Manager    Marketing   $9,500
500  Randy   DBA        Technology  $6,000
 
$ awk '/n/ {print $2,$NF;}' employees.txt
Thomas $5,000
Jason $5,500
Sanjay $7,000
Nisha $9,500
Randy $6,000


Good to visit: