Thursday, February 27, 2014

Configuring Selenium with Eclipse on Windows

Automation is not just about recording and playback the scripts. Its actual value comes far more after you write robust reusable, repeatable and maintainable scripts. To do that you have to have the tool that support designing scripts for such purpose. Many automation tools come with scripts editor to write dynamic code that is repeatable and reusable.

Since selenium is an opensource browser automation tool that is easily integrated in the FireFox browser to recording the application common scenarios and playing it back for verification. If you want to go further in test automation you will need a bit of liberty where you can design and develop dynamic scripts that can not be done easily with Selenium IDE.

Required downloads


Configuration


  • Run Eclipse (after download, unzip the folder no special installation).
  • Set you desired directory as Eclipse workspace (this where you want to save all your projects).
  • Click on File -> New -> Java Project or JPA Project.
  • Name your project, say 'Test' and click Finish
  • Right-Click on the newly created project and then click - > New -> Package
  • Name the package, say 'com' and click Finish.
  • Again right-click on the project name 'Test' and then Properties - > Java Build Path
  • Select the Library tab, if not already selected.
  • Click Add External JARs button
  • Access the path, where you downloaded it, of Selenium Java Client driver.
  • Select Zip/JARs and click Open button, all JARs would be added.
  • Click again Add External JARs button
  • Access the path, where you downloaded it, of Selenium Server Standalone.
  • Select Zip/JARs and click Open button, all JARs would be added.
  • Go to the Package 'com', right-click on it, New -> Class.
  • Name the class as 'MyTestCase'. Remember to keep it 'public' and check 'public static void main(String[] args)' and 'Inherited abstract methods'. Paste the code snippet in your Eclipse IDE.
  • Run the scripts
Code Snippet

package com;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.By;
import org.openqa.selenium.firefox.*;

public class MyTestCase {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
WebDriver driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
driver.get("https://www.google.com.pk");
driver.findElement(By.id("gbqfq")).sendKeys("Software Quality Geeks");
driver.findElement(By.id("gbqfq")).submit();
driver.findElement(By.linkText("Software Quality Geeks")).click();
//driver.quit(); //uncomment this line if you want to quit browser after test run.

}

}


Other things to consider

Eclipse and Java must be of same bit architecture. For example if you are using 32 bit Eclipse then use 32 bit Java and the same is true to for 64 bit. Otherwise it would be little cumbersome to configure the cross bits eclipse and Java if you're a beginner.

Saturday, December 28, 2013

Things I like as tester (impersonating user) about Google - A short one.

After using too much Google products and services I have realized that how much effort they had put up on grabbing such a vast number of people to use their products and services as a preferred choice. And why I think so I will share an example, as a tester, that is impersonating as an end user.

Google Translate (translate.google.com)

This is the product that I use too often while I have to see different translations for different languages (not that accurate thought :)) but it gives you enough idea about requested translation. So, I was having difficulty in grasping the word "Irony" in English to English so I picked up description of the word in English and thought of the Google Translator straightaway and before launching the http://translate.google.com the evil tester from the subconscious came into conscious mind and I used one of the way I use to join running program* with its required arguments and it was unexpected as per my evil thinking Google has tested this.

I provided the URL as <translate.google.com "Witty language used to convey insults or scorn, esp. saying one thing but implying the opposite">and rather than getting HTTP 404 or something dirty Google did it smoothly one text box contained the requested string and other contained the requested translation. 

I don't know whether Google tested this case explicitly but It took care of my expectation and you always go there where your expectations are honored.

*Running and opening file simultaneously:
 
When user want to open any file on any text editor or word processor software they usually launch the software and open file from some path, or directly go to the directory path where the file is present and double click to open it. Since I work on files that present on disparate locations so usually open the software by running it and simultaneously providing the path of the file e.g. pressing meta+R , writing notepad/winword "" and enter.

Saturday, June 29, 2013

Installation/Un-installation testing: Your first communication point with end-users.

It’s been almost a year that when I last added a blog post to Software Quality Geeks. Quickly getting towards the topic that today we will be having a look at Installation Testing. This blog post or next few ones, probably soon after this one, will have the same theme that rather than writing too much about the topic we should have a look at bird eye view of any quality or testing topic. Therefore, we will be learning at installation/un-installation testing and its coverage area with help of mind-map or brainstorming diagram.
Installation Testing is very import part of any software, because it usually requires some of sort of changes in customers or end-users machines so it must be tested carefully. Since this is the point when customer first communicates with your application, anything that goes awry at this time can cause enough damage to the business. Therefore, to avoid any potential loss to the business Installation Testing/un-installation testing should be a part of Test Plan and given enough time in testing the application as far as Installation/un-installation is concerned and for that following map can be referred and customized according the need, budget and timeframe.


The post is not open to comments, must provide your valuable ones.


Good luck for installation testing!

Sunday, August 12, 2012

Business Vs Functional Requirement


Chaps associated with the software development whether they are software engineers, business analyst or software quality assurance professionals are often confused about Business and Functional Requirements and are not easily able to distinguish from one another.

Let’s describe Business and Functional Requirements briefly followed by short scenario to get it right more clearly.

Business Requirement:

Any objective business or organization wants to achieve from software application. It could be single line statement or set of statements.

e.g. Pakistan Government wants to take all of its operations online and each ministry will have its separate online portal to cater respective population needs.

Presence of each business requirement in software applications is critical to its success.

Functional Requirement:

All the explicitly stated user requirements are considered as Functional Requirements. Also, any requirement that helps in achieving business objective but not specifically put forward by user is also considered as functional requirement.

e.g. Authentication required to login to application. Page load time shall not increase from 5 seconds.

Presence of each functional requirement in software applications may or may not be critical to its success.

Let’s take a following short scenario to understand practically the difference between business and functional requirements.

“Ministry of Education, Pakistan has decided to formulate the ratio between Pakistan’s States (Sind, Punjab, Baluchistan, KP and Kashmir) about population’s education and level of education (undergrads, grads and postgrads etc.) and devised a form for that purpose.”

In the above statement “education ratio between states population” is the business objective (business requirement) Ministry of Education wants to achieve. For that purpose, provision (i.e. user is able to select or provide his/her state he/she lives in) of States in the application is a success criteria of the application. Now, Functional requirement in this scenario is that Combo Box (pre-filled with states Sind, Punjab etc. user may select one out of available choices) or Textbox (user may type in his/her states he/she lives in) could be provided depending upon the feasibility of application.

Must comment if you like it.


Saturday, June 2, 2012

Managing Employees With Especial Needs


Although Pakistan ordained the Disabled Persons (Employment and Rehabilitation) Ordinance in 1981, many managers are still uncertain about how best to handle employees with special needs.

Here is the roadmap that can be followed

1. Have a work plan: Document the goals that should be achieved by the employee and his/her key responsibilities. Prepare a proper job description and a plan regarding how responsibilities will gradually be transferred to the employee.

2.    Know the core strengths: Be clear on what skills the person is bringing to the table. If administrative tasks are part of the employee’s job description, make sure that there are enough administrative tasks for the person to do. Repetition is boring for anyone, so ensure you have a job enrichment plan in place.

3.    Expect ethical behavior: The idea is to give equal not preferential treatment. Most people resort to treating people with special needs like children and make allowances for slack behavior in order to avoid confrontation. As with all other employees, you need to objective even if you feel guilty and sympathetic.

4.    Frequent feedback session: Whether it is regarding job performance, physical mobility or accessibility limitation issues, and regular one-on-one sessions with the employee will encourage trust and open communication.

5.    Make tough decisions: if there are complaints regarding e.g. unprofessional conduct, absenteeism or tardiness, consult your HR department and obtain 360-degree feedback on the employee to ensure that, you are being fair and have tried all options available to you before you take an action against the employee.
  
Nobody wants to discriminate against an employee with disabilities, but as a good manager it is important to stay focused on the core premise of a healthy work environment - equal treatment for all employees.


Saturday, May 26, 2012

Software Defect Aging

The term defect aging in software testing is very common term not for Testers but usually for Software Test Leads, Test Managers and Project Managers. Defect aging is basically let these chaps know how long it has been the defect under question is not closed or still open and/or how many times the software defect life cycle is performed on that defect. The greater the number of software defect life cycles performed on any defect the greater the cost actually incurred on that defect, and this is the very alarming sign for any project and project team as well.

Defect aging also helps in analyzing the performance of the testing team and software development team. If the defects are fixed and closed in the very first software defect life cycle then this will let the Project Manager that its software development team is on the right track with right performance.

In order to keep track of the things discussed above the organization should have robust test management systems or tools. Defect Aging with manual work will be cumbersome to manage; the tools and TMS do it for you easily. The test management tools keep track of the defect status, who changes it and when changes it and this way it gets automatically find out that how many times the software defect life cycle have been performed on any particular defect.

Tuesday, April 3, 2012

Quality Family and Definitions

 Quality:  Conformance to explicit and implicit requirements and adherence to defined standards.


Quality Control: Are set of reactive activities (testing, inspection, technical reviews) to uncover defects injected into the product by people and/or processes.


Quality Assurance: are set of preventive activities that prevent defects to be injected into the product/project by people and/or processes.


Quality Improvement: Lessons learnt throughout the project/product life cycle when something went wrong or well. Adopting practices/processes (for future project/product life cycles) that worked well and avoiding those that created a mess. E.g. decide on whether to adhere to inspection of artifacts produced in different life cycle phases or it can be skipped if that not worked (according to objectives set when project is initiated) in some specific cases.


Measuring Quality: The degree to which the conformance to explicitly stated requirements is achieved. Numerically, number of client reported issues, number of defects uncovered during testing, inspection, reviews, effort variance in completing activities.