Wednesday, June 21, 2017

Java Introduction

This article is specifically deals with details of Java and its introduction. Understanding Java is more needed for working efficiently with the Automation testing tools like Selenium.


Java is created and introduced by James Gosling as programming language in 1991. Introduced company is Sun Microsystems. First version of Java is 1.0 (1995) and the latest version is 1.8 termed as Java8. Oracle acquired the company Sun Micro Systems inn year 2010. It has the general license called GPL – General public license.
Java Platform consists of below items:
1.       Programming language -  Java language has its own structure , syntax , programming paradigm and rules. It is derived from c language so the code blocks are modularized same as like { }. Structurally java starts with Namespace àProject àPackageàClasses àmethods and variables etc hierarchy.
2.       Java Compiler – Generally when we program for java platform, source code will be in .java files. During the compilation, the compiler checks against the syntax and converts/write into byte code in .Class files. These byte codes are targeted to run on JVM(java virtual machine). Java compilers differs from other compilers
3.       JVM -  During runtime, it interprets the .class files into native program instructions where CPU would interpret assembly language instructions. Difference is that JVM is software that will be specific for specific platform. – “Write Once, Run Anywhere”

Java distribution comes under two flavours
JRE – Java Run Time Environment
JDK – Java Development Kit
Difference between JDK and JRE:
1.       JRE consists of the JVM and the Java class libraries. Those contain the necessary functionality to start Java programs.
2.       JDK additionally contains the development tools necessary to create Java programs. The JDK therefore consists of a Java compiler, the Java virtual machine and the Java class libraries.

1.       Platform Independent – “Write Once and Run anywhere”
2.       Object Oriented Programming Language - Except the primitive data types, all elements in Java are objects.
3.       Strongly typed programming language -Java is strongly-typed, e.g., the types of the used variables must be pre-defined and conversion to other objects is relatively strict, e.g., must be done in most cases by the programmer.
4.       Interpreted and Compiled language - JVM
5.       Garbage Collector -Automatic garbage collection is another great feature of Java with which it prevents inadvertent corruption of memory. Similar to C++, Java has a new operator to allocate memory on the heap for a new object. But it does not use delete operator to free the memory as it is done in C++ to free the memory if the object is no longer needed. It is done automatically with garbage collector.
6.       Java supports Multithreading -Java language is that it allows multiple threads of execution to run concurrently within the same program A single Java program can have many different threads executing independently and continuously. Multiple Java applets can run on the browser at the same time sharing the CPU time.
7.       Java is distributed - extensive set of routines to handle TCP/IP protocols like HTTP and FTP java can open and access the objects across net via URLs.
 





Monday, May 8, 2017

Types of locators in selenium with Simple examples

Locators in selenium are used to locate the web elements in page. Identification of correct expected web element and to perform some action on it will be the expectation in Automation. Selenium IDE is the plugin that will be more helpful to identify the locate the elements in GUI page. We can use that locator value while doing the scripting. Each and every web element are presented in HTML tag with open and End tag will be identified through its attributes.

Different types of locators in selenium are listed below.

  • ID
  • Name
  • Link
  • CSS Selector
  • Xpath
  • DOM


Target Area - IDE

Locating by ID:

Always ID is the attribute present in html tag of the web element will be unique. Some of the web elements will not have the ID attribute.

Syntax :

 id= value of Id of that Specific element

Locating by Name:
Name attribute will be used to identify the element using the name attribute of element.

Syntax :

Name = Value of Name attribute of that specific element


Locating by Link:

It used to identify the hyperlink element in the webpage.

Syntax :

Link = linktext

Locating by CSS Selector:

It is used to identify the web elements using string patterns. When an element doesn’t have usual attributes with unique values such as ID,Name, Class name etc, we can make use of it.
It will be very fast in accessing the web elements comparing to other locators.

Syntax and its CSS types:

  • Tag and ID   ----> css=Tag#id
  •  Tag and class ----> css= Tag.class
  •  Tag and attribute ----> css= tag[attribute = Value]
  • Tag, class, and attribute ----> css=tag.class[attribute = value]
  •  Inner text ---> Tag:contains("text")


When using this strategy, we always prefix the Target box with "css=" as will be shown on the following examples.

Locating by Xpath:

XPath is the language used when locating XML (Extensible Markup Language) nodes. There are two types in Xpath.

Absolute path – Full path
          Relative path – Reference path


Syntax and its Xpath types:

  • Using Single attribute  -//Tag[@attribute = ‘value’] 
  • Using Multiple attribute-//Tag[@attribute1=’value1’] [@attribute2=’value2’]
  • Using Contains method   -//Tag[contains(@attribute,’value’)]
  • Using Starts-with       -//Tag[starts-with(@attribute,’value’)]
  • Using Following         -//Tag[@attribute =’value’]/following::Tag/
  • Using Preceding         -//Tag[@attribute =’value’]/preceding::Tag/
  • Parent                  -//Tag[@attribute ='value']/parent::*---->
  • Child                   -//child::tag
  • Siblings                -//Tag[@attribute =’value’]/preceding-sibling::Tag/
  • Siblings                -//Tag[@attribute =’value’]/following-sibling::Tag/


Document Object Model (DOM)

HTML elements are structured. Selenium IDE is able to use the DOM in accessing page elements.

Syntax for DOM:

  •      document.getElementById("pass")
  •      document.getElementsByName("servClass")[1]
  •      document.forms["home"].elements["userName"]   ----> Only applicable when having forms
  •      document.forms[0].elements[3]



Tuesday, April 25, 2017

Software testing Lifecycle - Simple article

Phases in Software testing life cycle will be listed below. This cycle later phases will get changed based on traditional development life cycle and latest agile methodology or Scrum framework

Requirement Analysis:

This phase deals with analysing the requirements through SRS(System requirement) and BRS(Business requirement) documents. Traditional SDLC like Waterfall, Prototype and spiral will have late testing is due to this that we will cover on principles of testing. Analysing the requirements at later stage and identifying the requirement issues at later stage will cause major impacts to the application in sense of business. Outcome of requirement analysis phase is Strategy document.

Test Strategy Document -  Test Manager – Static Document
1.       Business priorities
2.       Risk and its mitigation
3.       Testing tools
4.       Automation testing needed or not
5.       Process of test execution
6.       Type of testing
7.       Training needed or not


Test Planning:

Test Plan Document - Test Manager/ Test lead – Dynamic document

It will change throughout the testing lifecycle and also it will answers the below questions with planning.

1.      When- When the testing for the feature or module is going to be performed?
2.      What - What are the expectation in the functionality or feature?
3.      Where - Where refers the test environment includes os and browser.
4.       How - How means the approach or type of testing going to be performed for that feature.
5.       Who -Who means the resource person going to execute the specific feature or functionality as per plan.

Test Case Development:

1.       Preparing test cases
2.       Test data Preparation
3.       Automation Framework Selection

Environment Setup:

1.       Test case review - Review the prepared test cases and ensure with the team that the scope is covered in the test case.
2.       Updating of test cases based on the feedback received from the peers.

Test Execution:

1.       Executing the test cases and identifying potential bugs
2.       Assigning bugs to appropriate developers and follow-up for its closure
3.       For Agile, It will happen in parallel cycles in every build

Test Cycle Closure:

1.       Preparing the test report
2.       Sent it to appropriate distribution list daily, weekly or bi weekly manner.


Thursday, March 23, 2017

Tips to design your test data

Tips to design your test data

Tester should always focus in test data that he is going use for validating an application. Aim of this article is to provide importance of test data in testing as well as to provide the standard guidelines to prepare test data that can be used for testing.
Test Data Introduction:  
Test data is nothing that the inputs that are planned by the tester to test the software/application. These planned data or inputs are added as column in the test case to showcase that these type of input should be given. This documentation of adding the inputs will be done during the test case preparation. Based on the input expected result of the application functionality will get differs that are all added as different scenarios during the test case preparation.
Importance of test data:
If the test data’s used in the application is good then the quality of the product will gets reached its maximum level. We can test both the field and data level validations using test data.
Test data are used to check and ensure that the desired functionality is achieved or not.
Type of test data which we used will help the developers to ensure the fix for the problems.
Different scenarios and flows can be planned based on the input data in testing.


Test data types and its usage:

Creating the test data is an art that will be helpful and different based on type of testing we are performing. Bulk amount of  test data is needed for Scalability, Integration, Volume testing, Load and  Performance testing.
Test data can be prepared and defined in below types
  1. Valid input data -  This data is indented to test whether the application is working in happy or positive flows
  2. Invalid input data - This invalid inputs are useful to verify the application is working when tried with negative inputs and flows
  3. Boundary test input data – When range kind of input comes into testing please use boundary testing
  4. Empty without any data - When input is expected trying without any data
  5. Special characters and wrong input data format  - Entering the values that are all not relevant to the system or application functionality

Tips for creating efficient test data:

  1. Always test data should be updated based on requirement changes in that specific area of application in frequent intervals. Otherwise your expected result will be wrong and application may be correct.
  2. Test data should be designed during the test case preparation. It will be reviewed by the team during the test case review that will be helpful for team add inputs or suggestions to improve the quality of data.
  3. If there necessity of creating large amount of data for kind of evaluating the product in the perception of scalability try to generate the large amount of data to be loaded in the test environment using Data Generation tools. Manual creation of test data will be higher than the testing time.
  4. Test data should always cover the happy flow as well as all possible negative flows of an application.
  5. Make sure to keep the test data along with the test case if it is manual testing. If we are using data files as input to an application make sure that file is not corrupted.
  6. Ensure that we have used black box and white box testing techniques to create test data. This approach will make tester to avoid exhaustive testing.
  7. Utilize developers thoughts while framing the test data that will enrich the quality of test data.
  8. Identify dependable fields in an application to create inputs that affect other fields.
  9. Test data should be related and meaningful to that specific functionality of the application.



Wednesday, March 15, 2017

Software testing and its objectives

This post mainly covers the basic information about what is testing and the main objectives of the testing team

  What is Testing?
   It is a process of verifying are we developing the right product or not and also validating does the
  Developed product is right or not.

  Software testing = Verification(QA Process) + Validation(QC Process)

 What is Verification?

    It is a process of verifying: Are we developing the right product or not.  This is also known as static testing. It will define the process and also ensure that the team is following the process as expected.

 What is Validation?

    It is a process of validating: Does the developed product is right or not. This is called as dynamic testing. It is termed as real test execution. That may be manual testing or automation testing

 Objectives of Testing:   

  1. To confirm whether the application is developed according to customer requirements or not
  2. Finding defects
  3. To make sure all problems are resolved and close.
  4. Finally testing is helpful to deliver a quality product and risk-free product to the customer