Thursday, August 18, 2011

Are you familiar with any Defect Tracking Tool?

In past I have used Quality Center which is a very popular tool from HP. I have used it to plan my testing, to write test cases and loading it to test lab based on testing scenarios. I have experienced using MS Product Studio and MS Team Foundation and One open source tool call Bug Tracker

Why testing?

Testing helps to, quality of software can be measured. Testing helps to find defects in software product from different point of views. Testing gives confidence about software's quality.

What is functional specification?

It is a document describing how your end product, your program look and work. It defines what is the application supposed to be, What it supposed to do and who will be using it in general.

Thursday, July 28, 2011

How to find elements by CSS?

Before learning how to use CSS, lets learn little bit about CSS itself.

CSS (Cascading Style Sheets): A Web page with no styling appears as white background and black font. It it the browser default style. CSS adds style to a web page.sELECTORS rhe most mportant aspect of CSS. It helps to select tag to apply certain style.Two major selectros are: ID and Class selector.
ID selector starts with '#'. It applies only to the tag in a page that contains id=name, and only one element on a page.
HTML:
<!--
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>example one</title>
</head>
     <body>
<div id="header">
<h1>this is header</h1>
</div><!-- End header div -->
<div id="lefty">
<ul>
<li>We are <em>list items</em></li>
<li>in <strong>lefty</strong>.</li>
</ul>
    </body>
</html>
-->


CSS:
 /* Applies to id="header" */
# header
{
text-align:center;
color:red;
}

Class:
Class selector can be applied to any number of tag in any page. It starts with a dot (.) followed by the class name. Name is case sensitive and should begin with a letter. The class selector's style applies those tag that have class name.
Example:

HTML:
<div id="heading">
<h1>Heading</h1>
<ul>
<li>names</li>
</ul>
<p class="mark">para1.</p>
</div>
CSS:
/* class selector */
.mark{
background-color:#ff0;
}                                                                                                                                                                                                                               

Wednesday, June 22, 2011

Selenium IDE and its useful features

Selenium IDE, a firefox extension is the easiest way to record, edit, debug and run web test. Selenium is a web application testing system and selenium IDE (sometime refereed as SIDE) is a part of it. Once download, it appears as a Firefox plug-in under 'tools'. Selenium IDE works only with Firefox browser. A Selenium test recorded in Selenium IDE can be run in other browsers with the Selenium Server.

Installation :
You can download Selenium IDE from:
http://selenium-ide.openqa.org/download.jsp

If you want to open it, lunch the Firefox browser then go to  Tools> Selenium IDE.You will see the following window.




Selenium IDE is a lightweight tool and it doesn't have a lot of features as well. Some of the important features are:

Base URL: The base URL of the application. Selenium IDE automatically captures it. Test starts with this URL and all 'open' command will be relative to it unless a full path is specified with 'open' command


User Extensions: You can add new actions and assertions in selenium IDE with javascript. Create your own user-extension and save it as .js file. Go to Tools-> Options and browse your js file here. Next time when you open lunch your Selenium IDE, it will be available in command drop-down. To learn more about Selenium User Extension visit here.



Wednesday, June 15, 2011

Selenium HTML-Testrunner framework with 2.0rc2

There are so many languages and frameworks for selenium, such as JAVA, jUnit framework, and C# .Net. These are excellent if you are comfortable with one of the languages and tools. It will help you to create dynamic, advanced test framework according to your test need. Moreover, it opens door to use powerful development language in your test. For example if and else logic.
However, this HTML framework is easy and requires low maintenance. It is powerful enough for most of the automation need and you can use javascript to make your test more meaningful if necessary. You as an automation tester do not need development language either.
Please follow these steps if you want to adopt this for your test automation purpose. I have used website facebook login page for this tutorial. I am assuming you know about selenium IDE and recording the recording. If answer is ‘no’ then going to this page and come back here.
Download Selenium Server
  • Go to http://seleniumhq.org/download/. It is also known as Selenium Server. 
  • If you cannot   find stable build find from this page: http://code.google.com/p/selenium/downloads/list.
  • It is a .ZIP file. Once download is completed unzip it in C:\selenium
  • Test it.  To test it runs properly follow the following step:
1.   Open command line.
2.   Go to the folder that contains the selenium server. (You can go using DOS cd command to navigate from one folder to another.). Type following commands: java -jar selenium-server-standalone-2.0rc2.jar. If it runs successfully, you will see the following screen:


If it doesn't run check the error message. Usually, problem is with the port. Selenium server’s default port is 4444. If it is taken already, problem occurs. Easy solution is to restart your machine.
 Next step is to run your script from the command line. Before I explain more about it, let me share my file and folder structure with you. Please look at the files/folders inside 'selenium' folder carefully before you try to run script from the command line.
fb_1
I have stored my Scripts in this fb_1 folder. Second picture is about where I have put my Selenium Server 2.0

 login:
 In this folder I have my script file 'login'. I hope you have saved or renamed all your script with .html extension. If not please do that.
testsuite:
I have created one more .html file named 'testsuite'. (Or you have directly save your test script as "save test suite as"). Here I am going to explain about HTML file I have saved as testsuite.
 This .html file is a part of selenium HTML-testrunner framework and should be kept inside same folder. My script is associated with this file. Let me copy and paste what I have inside my testsuite file:



1:
It is a batch file to run test with one click.
result1:
It is the result. It should get updated after each test run.

selenium-2.0rc2


This is simply unzipped selenium server.
Now we are ready to run our test. You can name your folder and file name anything. But make sure your command is pointing to right path.
Running Test:
I am able to run my test successfully with the help of following command:
java -jar selenium-server-standalone-2.0rc2.jar -htmlSuite "*firefox" "http://www.facebook.com" "c:\\selenium\fb_1\testsuite.html" "c:\\selenium\fb_1\result1.html"
This command invokes test runner. This looks like:
:


To run test in different browser replace *firefox with :-
*chrome
*iexplore
*safari
Once you can run your script successfully, save your command in a notepad with .bat extension. Next time when you want to run your test, just double-click this batch file. You can schedule your batch file to run automatically at a specific time as well. For this use windows scheduled Task utility. You can add as many test script as you want in your batch file. Another will run automatically once previous stops running.
Always remember, Selenium is an open source tool, you might get so many errors before a successful test run. Try to make fewer errors from your side.                   

Thursday, June 9, 2011

Selenium - All you need


On the way...
Selenium Starter Kit
 2.  Selenium Scripting - Simple
 3. How to create a test suite in Selenium?
 5. Variable substitution, Store command, regular expression.
 6. Javascript solutions for selenium.
 7. Using xPath - xPath solutions.
 8. How to find elements by CSS? - very useful
How to create test suite using jUnit and eclipse in selenium

Wednesday, May 25, 2011

ISTQB Question set # 1

 Highlight the area next to the 'Answer:' for right answer.

1. Which one of the following are non-functional testing methods?
a.  System testing
b.  Usability testing
c.  Performance testing
d.  Both b & c

Answer: d

2. Pick the best definition of quality
a.  Quality is job one
b.  Zero defects
c.  Conformance to requirements
d.  Work as designed

Answer:C

3. Boundary value testing...
a.  Is the same as equivalence partitioning tests
b.  Test boundary conditions on, below and above the edges of input and output equivalence classes
c.  Tests combination of input circumstances
d.  Is used in white box testing strategy

Answer: b

5. White Box Techniques are also called as
a.  Structural Testing
b.  Design Based Testing
c.  Error Guessing Technique
d.  Experience Based Technique

Answer: a

6. Which of the following is a MAJOR task of test planning?
a  Scheduling test analysis and design tasks.
b Initiating corrective actions.
c Monitoring progress and test coverage.
d Measuring and analyzing results.

Answer: a

7. Where may functional testing be performed?
a.  At system and acceptance testing levels only.
b.  At all test levels.
c.  At all levels above integration testing.
d.  At the acceptance testing level only.

Answer:
a

8. Who would USUALLY perform debugging activities?
a. Developers
b. Analysts
c. Testers
d. Incident Managers

Answer:
a

9. As part of which test process do you determine the exit criteria?
a. Test planning.
b. Evaluating exit criteria and reporting.
c. Test closure.
d. Test control.

Answer:
a

10.What is beta testing?
a. Testing performed by potential customers at the developers location.
b. Testing performed by potential customers at their own locations.
c. Testing performed by product developers at the customer's location.
d. Testing performed by product developers at their own locations.
 

Answer: b

11. A thermometer measures temperature in whole degrees only. If the temperature falls below 18 degrees, the heating is switched off. It is switched on again when the temperature reaches 21 degrees. What are the best values in degrees to cover all equivalence partitions?
a. 15, 19 and 25.
b. 17, 18 and19.
c. 18, 20 and22.
d. 16, 26 and 32.

Answer: a

12. Which of the following is TRUE?
a. Confirmation testing is testing fixes to a set of defects and Regression testing is testing to establish whether any defects have been introduced as a result of changes.
b. Confirmation testing is testing to establish whether any defects have been introduced as a result of changes and Regression testing is testing fixes to a set of defects.
c. Confirmation testing and Regression testing are both testing to establish whether any defects have been introduced as a result of changes.
d. Confirmation testing and Regression testing are both testing fixes to a set of defects.


Answer: a  

13. Deliverables of the test design phase include all of there except:
a. Test Data 
b. Test Data Plan
c. Test Summary report
d. Test Summary Plan 


Answer: c

14. Which of the following is not decided in the test-planning phase?
a) Schedules and deliverables
b) Hardware and software
c) Entry and exit criteria
d) Types of test cases

Answer: d

15. Deciding how much testing is enough should take into account:
i. Level of Risk including Technical and Business product and project risk
ii. Project constraints such as time and budget
iii. Size of Testing Team
iv. Size of the Development Team

a) i, ii, iii are true and iv is false
b) i, iv are true and ii is false
c) i, ii are true and iii, iv are false
d) ii, iii, iv are true and i is false


Referring to ISTQB Syllabus:
1.1.5 How Much Testing is Enough? (K2)
Deciding how much testing is enough should take account of the level of risk, including technical, safety, and business risks, and project constraints such as time and budget.  Risk is discussed further in Chapter 5.
Testing should provide sufficient information to stakeholders to make informed decisions about the release of the software or system being tested, for the next development step or handover to customers

Answer: c

16. Which of the following is not phase of the Fundamental Test Process?
a) Test Planning and Control
b) Test implementation and Execution
c) Requirement Analysis
d) Evaluating Exit criteria and reporting


Referring to ISTQB Syllabus:
1.4 Fundamental Test Process (K1) 35 minutes
The fundamental test process consists of the following main activities:
  • Test planning and control
  • Test analysis and design
  • Test implementation and execution
  • Evaluating exit criteria and reporting
  • Test closure activities
Answer: c

17. COTS is:
A. Commercial off the shelf software
B. Compliance of the software
C. Change control of the software
D. Capable off the shelf software

Answer: a

18. The bug tracking system will need to capture these phases for each bug.
I. Phase injected
II. Phase detected
III. Phase fixed
IV. Phase removed

A. I, II and III
B. I, II and IV
C. II, III and IV
D. I, III and I

Answer: B

19. Correct bug life cycle
A. Open, Assigned, Fixed, Closed
B. Open, Fixed, Assigned, Closed
C. Assigned, Open, Closed, Fixed
D. Assigned, Open, Fixed, Closed

Answer: A




 

Monday, May 16, 2011

Functions available in SQL

There are two types of SQL functions:
  • Single row functions: This type of functions operate in single row only and result one result per row. Some useful single row functions are: Date, Character, Conversion, Number. It is usually used with SELECT statement,  WHERE and ORDER BY clause
  • Multiple row fictions: Also known as group function, this type of functions manipulate group of rows to give one result per group of rows.
Character Functions: 
Character functions accept character data as an input and can return both character and numeric values. Character functions can be divided into case-conversion and character manipulation types.

LOWER, UPPER, INITCAP are the three case conversion functions. 
Some Character -manipulations functions are : CONCAT, SUBSTR, INSTR, LENGTH, LPAD, TRIM


Number functions:
Number functions accept numeric input and return numeric input.
ROUND: rounds to the nearest unit of 100.
TRUNC: truncates the column, or value to n decimal places.
MOD: finds the reminder of the first argument divided by second argument. It is frequently used to determine whether a value is odd or even.

Date related functions:
Oracle's default date format is : DD-MON-RR. RR date is similar to YY but it also specify century. RR determines the default value for century in INSERT.
SYSDATE function: returns current database server date and time. If your database in London and you are in California, it will display London current time. CURRENT_DATE functions returns date, time in the session time zone. So use it for California time.
Some other date manipulation functions are: MONTHS_BETWEEN, ADD_MONTHS, NEST_DAY, ROUND, TRUNC.
Date function can be combined with Arithmetic function: date+number, Date-number, date-date, Date +number/24.

Conversion Functions:
Nesting Functions:



    Monday, May 9, 2011

    Database Related Interview Questions

    This is useful for advanced level Database Test Professional and Database Developer and DBA beginner. All questions-answers are based on Oracle Database Management System.

    1. What is a Database?
    An organized collection, storage of information.

    2. What is DBMS?
    To manage database, you need some type of system which, that system in Database Management System(DBMS). So, it is a program that stores, retrieves, and modifies data in database based on request.

    3. Name some types of databases.
    There are four main type of databases: hierarchical, network, relational, and object relational (this type is a new one).

    4. What is Data Models?
    It is a model developed before building a database system to explore the ideas, improve and understand overall database design. A data model should contains details for database developers, Database Administrators to build and maintain a database system.

    5. What is a unique identifiers(UID)?
    UID is any combination of attributes or relationships, or both that serves to distinguish entity. Each entity occurrence must be uniquely identifiable. Each attributes that is part of UID is tagged with #, secondary UID with(#).


    6.What is primary key and foreign key?
    here

    7. How do you operate relational database?
    By using SQL language. To access database, you can use SQL statements. There are other application programs and tools are also available. But these also use SQL language based on user's request.


    8. Tell me about different types of SQL statements.
    Data Manipulation Language(DML) ----- SELECT, INSERT,UPDATE,DELETE, MERGE
    Data Definition Language(DML) ----- CREATE, ALTER, DROP, RENAME, TRUNCATE, COMMENT
    Data Control Language(DCL)----- GRANT, REVOKE
    Transaction Control----- COMMIT, ROLLBACK, SAVEPOINT

    9. What is table join,  which SQL statement do you use to join tables?
    Joining brings together data that is stored in different tables by specifying the link between them. It helps to display data from multiple tables. SELECT statement is used to join tables.


    10. What is a Null value?
    If a row lacks a data value for particular column, that is called a null. Null value means value is unavailable or inapplicable. It is not a zero or blank space. Some constraints  like NOT NULL or PRIMARY KEY prevent null value being used in the column.

    11. What is Concatenation Operator?
    It is used to link columns to another columns, arithmetic  expressions, constant value to make a single output column. Operator sign is - || and it is used with select statement where output column name comes after AS keyword. For example:
    SELECT column1||column2 AS "OutputColumnName" from table

    12. What is a Literal Character Strings ?
    A literal is a character, a number, or a date that is included in a SELECT statement. It is not a column name or alias, it is something you use between || and || which will be displayed with query result. ' ' is used for date and character literal. It is used with select statement.


    13. What is 'Rules of Precedence'?
    It determines the order in which expression are evaluated and calculated. You can override the default order by using parentheses around the calculation that you want to calculate first.

    14.How do you display the Table structure?
    You can display table structure by using DESCRIBE command.It will display the column names, the data types and constraints(if any).


    15: what is SQL Function?
     here

    16: what is RR Date Format?
    It is the default date format of some database including Oracle.The default date format is: DD-MON-RR. RR date is similar to YY but it also specify century. RR determines the default value for century in INSERT.


    17. Explain about different types of joins in brief.
    Natural joins:The NATURAL JOIN clause is based on the all columns in the two tables that have the same name and data types.
    Self Join: Joins a table to itself.
    Nonequijoins: A join condition containing something other then an equality(=) operator.
    Outer Joins: returning results with no direct match.
      LEFT OUTER JOINS
      RIGHT OUTER JOINS
    CROSS JOINS

    18. What is a schema?
    A schema is a collection of objects such as table, views.





    What is Relational Databae Management System(RDBMS) ?

     A relational database is a collections of relations among two-dimensional tables. In this model, you create several tables to store pieces of information. There are operators/a set of operators that to produce the relations.
    In RDBMS,  Each row of data in a table is uniquely identified by a primary key and logically relate data from multiple tables using foreign key.

    Table: Employee
    Employee_ID First_Name Last_Name Department_ID
    101 Kobe Bryant 55
    102 Rhojan Rondo 50
    103 Ray Allan 45

    Table Name: Departments
    Department_ID_ID Dept Name Manager_ID
    10 LAL 4
    11 CEL 34
    11 CEL 4


     Data about different entities is stored in different tables.You may need to combined information from two tables to get a particular information. In RDBMS,  information is related by foreign keys that refers to the primary key in the same table or another table.
    Above, table 'Employees' contains information about employees and table 'Departments' contains information about departments. Department_ID which is Foreign Key in Employees  table is Primary Key in Departments.

    There are some rules/guidelines for assigning Primary Key and Foreign Key.
    You cannot use duplicate value in primary key
    Primary key generally cannot be changed
    Foreign key is based on data value and is a logical pointer.
    A foreign key must reference either a primary key or a unique value column.
    A foreign key value must match an existing primary key value or unique key value, otherwise it must be null.
    RDBMS are composed of objects or relations and are governed by constraints.

    Thursday, April 21, 2011

    Database Testing - Conceptual Understanding



    Have you ever think about what happens when you deposit any amount in your bank account?
    when you deposit amount, an event occurs, a program is executed and changes the database values according to event occurred in a corresponding way. It should not only add deposit to one table and not affect other relational tables.
    Basic theory is ACID, basic properties of a database transaction:

    Automaticity:
    An action must be either completed or aborted. The transaction cannot be partially successful. It must do ALL what it supposed to do or NOTHING. If one part of transaction fails entire the database transaction must be aborted.
    If the transaction successfully completes it is said to commit. The system is responsible for ensuring that all changes to the database have been saved. If the transaction does not successfully complete, it is said to abort. The system is responsible for undoing, or rolling back, all changes the transaction has made.

    Consistency:
    The transaction takes the resources from one consistent state to another. Application developer is also responsible who must make sure that all known integrity constraints are enforced by the application level as well. All integrity check, constraints, Rules, and triggers must be applied during transaction.

    Isolation:
    Transactions execute in sequence. Each one starts after the previous one completes. Execution of one transaction is not affected by the operations of another since they do not overlap in time. The execution of each transaction is isolated from all others. (Serial execution is inadequate from a performance perspective.)

    Durability:
    Changes made by the committed transaction are permanent, data should be changed permanently.

    A tester needs to think about capacity of database; size while deploying the QA box, how much data is there and how system is behaving with different size of data. Data mapping and Default data integrity are also important. (consistency). Now a days, Big business Software developments use OOP (Object Oriented Programming). Front end JAVA, C#, and back end Oracle, SQL Server. Another important aspect of RDBMS and OOP is related ‘object’. Mapping Objects to the relational DB based on relationship is one of the major tedious, but sensitive tasks. (Just a gist of data mapping, I am stopping this topic right here, because data mapping is a heavy weight topic and more relevant to talk within ETL).
    Compatibility is another big issue. Tester is not the one to decide about what is compatible with what; it should be more on project level than test level. But, a tester can do parallel testing, migration testing, etc. after migration to new version or after adding new system.

    Stored Procedure Testing:
    A SP needs to broken into action based on functionality and needs to be tested separately. A tester can write negative and positive test cases based on number of arguments, data types, orders of arguments, and return value and data type of return value being passed. People often consider it is difficult (being white box type) but. If there is an existing document explaining all these, SP test is not that complex. Of course knowledge of SQL language is vital.
    Other important aspects of Database testing are data type. Sometime developers mess up using same kind of data-type in front end and back end. A DB tester should make sure about it. Data type, size is also a performance related issue. It always make your marks as good tester if you to bring those issues during meetings. (if you are sure about what kind of Data-type  is right from business, performance and other technical point of view).
    Data-Driven Testing is a method to test many data with same script. Creating a script to provide data is an important task of a tester. There are many automation tools to create a capture and playback the script.


    Tuesday, March 15, 2011

    ISTQB preparation guide - 1. Know this before getting started.

    - 40 multiple-choice questions, total time - 60 minutes. No negative point.  65% is required to pass the exam.
      - Questions are from the syllabus. Read it carefully focusing on the TERMS given on the top of the chapters before jumping to other books or joining any training.  Questions are not that hard but answers are confusing and similar.
        - Prepare based on K1, K2, K3 and K4 breakup of syllabus, questions are divided according to it : K1-50%, K2-30%, K3, K4-20%(most of the time)
          Fundamental of testing -  7
          Testing throughout the Software Life-Cycle -           6
          Static Techniques                    3
          Test Design Techniques          12
          Test Management                  8
          Tool support for Testing        4

          - Prepare some software testing terms. Go here to know some software testing terms.


          Just a Thought


           

          QA Interview Questions - all you need

          Sunday, February 20, 2011

          Saturday, February 19, 2011

          Selenium Interview Queations-Answers

          How do you use javascript into script?
          by putting  javascript{} into the target or value box within the Selenium IDE.



          What is Selenium?
          Selenium is a widely used automation tool for web based testing. It is easy to learn and use.

          What is Selenium 2.x?
          The NEXT GEN selenium. It is the Selenium Server-Webdriver replacing Selenium RC

          What is required?
          Basic knowledge of HTML, web based testing and web technologies is required. No other software development language is required. JAVA Script is nice to have.

          From where to download?
          Go to Selenium’s official site for all the information about it. You can download different version and mirror from its official site. which is -http://seleniumhq.org/

          Getting started with selenium.
          Selenium is a very good tool for Acceptance and Cross-Browser testing. It is also very useful for Functional testing. About how - Selenium has different components. Lets download selenium IDE’s latest version. Selenium IDE is a Firefox add-on, version 2+. Once it is download, you can record and play scripts in Firefox. I will talk in detail about how to use it in different section. for now lets download IDE, play around it and get familiar with most commonly used selenium commands. Selenium script is convertible in different development languages such and JAVA, C#, Pearl. With the help of Selenium-RC, user can run it different browsers and language environment.

          How to use selenium IDE?
           For now please go to http://seleniumhq.org

          What is the selenium's recording language?
          HTML

          What are the steps to run automation using selenium?
          The very basic steps are:
          1.  Record the test steps using selenium-IDE
          2. Modify the script according to the testing needs. Add validation points, Java Scripts, Time-out etc.
          3. Run the test
          4. View the result after test run complete analyze.

          Automation steps using Selenium C# language
          1.Record the Test Steps using selenium-IDE. Test will be recorded in HTML language
          2. Modify the script
          3. Convert the scripts into c# using selenium IDE
          4. Open the Visual Studio and create the test project there. Add a c# file
          5. Copy your c# script from Seleniun-IDE and paste into c# file you have created earlier. You can modify your script here as well such as adding if-else. This is the advantage of using other language.Call the Reporting file from here to store the result.
          6. Compile the code and debug if error occurs.
          7. Add the Compiles DLLs in NUNIT
          8. Run the test.
          9. Analyze the test result.

          What is Selenium Test Suite? how to develop it?
          Grouping test cases together as test suite is one of the major concept of software testing. In selenium, it is a HTML file that contains links of test cases. Test Runner is a Selenium IDE plug-in to run the test suite.


          What is SIDE?
          Selenium IDE


          How to run test case recorded using Selenium IDE in other browsers?
          With the help of Selenium -Remote Control


          What are three major parts, components of IDE?
          Command, Target, and Value


          How do you edit the recorded command in IDE?
          By selecting them and choosing the desired value from drop-down.

          What is the command to run selenium server from command prompt?
          Open the command prompt, CD to the folder (CD Command) having selenium server and run    command : java -jar selenium-server.jar

          What is the Selenium server default port number?
           4444

          How to run Selenium server, other than the default port 4444?
           java -jar selenium-server.jar -port

          Name some common commands
          click, type, verify, assert, open

          What is the purpose of 'verify' and 'assert' commands?
          'assert’ or ‘verify’ are used for verification checks. Test case keeps running if verify command fails, test case stops running if assert fails.

          What command is used for synchronizing the test execution?
          Commands ending with  ‘AndWait’ is useful for synchronization purpose. It makes script to wait until the page or element to be available after the action has been made. To handle ajax,  ‘waitFor’ commands is used.