Monday, March 17, 2008

Win Runner Questions


Which
scripting language used by WinRunner ?

WinRunner uses TSL-Test Script Language (Similar to C)

What's the WinRunner ?

WinRunner is Mercury Interactive Functional Testing Tool.

How many types of Run Modes are available in WinRunner ?

WinRunner provide three types of Run Modes.
Verify Mode
Debug Mode
Update Mode

What's the Verify Mode ?

In Verify Mode, WinRunner compare the current result of application to it's expected result.

What's the Debug Mode ?

In Debug Mode, WinRunner track the defects in a test script.

What's the Update Mode?


In Update Mode, WinRunner update the expected results of test script.

How many types of recording modes available in WinRunner ?

WinRunner provides two types of Recording Mode:
Context Sensitive
Analog

What's the Context Sensitive recording ?


WinRunner captures and records the GUI objects, windows, keyboard inputs, and mouse click activities through Context Sensitive Recording.

When Context Sensitive mode is to be chosen ?

a. The application contains GUI objects
b. Does not require exact
mouse movements.

What's the Analog recording ?

It captures and records the keyboard inputs, mouse click and mouse movement. It's not captures the GUI objects and Windows.

When Analog mode is to be chosen ?

a. The application contains bitmap areas.
b. Does require exact mouse movements.


What are the components of WinRunner ?

a. Test Window : This is a window where the TSL script is generated/programmed.
b. GUI Spy tool : WinRunner lets you spy on the GUI objets by recording the Properties.

Where are stored Debug Result ?

Debug Results are always saved in debug folder.

What's WinRunner testing process ?

WinRunner involves six main steps in testing process.
Create GUI map
Create Test
Debug Test
Run Test
View Results
Report Defects

What's the GUI SPY ?


You can view the physical properties of objects and windows through GUI SPY.

How many types of modes for organizing GUI map files ?

WinRunner provides two types of modes-
Global GUI map files
Per Test GUI map files

What's the contained in GUI map files ?

GUI map files stored the information, it learns about the GUI objects and windows.

How does WinRunner recognize objects on the application ?


WinRunner recognize objects on the application through GUI map files.

What's the difference between GUI map and GUI map files ?

The GUI map is actually the sum of one or more GUI map files.

How do you view the GUI map content ?

We can view the GUI map content through GUI map editor.

What's the checkpoint ?

Checkpoint enables you to check your application by comparing it's expected results of application to actual results.

What's the Execution Arrow ?

Execution Arrow indicates the line of script being executed.

What's the Insertion Point ?

Insertion point indicates the line of script where you can edit and insert the text.

What's the Synchronization ?

Synchronization is enables you to solve anticipated timing problems between test and application.

What's the Function Generator ?

Function Generator provides the quick and error free way to add TSL function on the test script.

How many types of checkpoints are available in WinRunner ?

WinRunner provides four types of checkpoints-
GUI Checkpoint
Bitmap Checkpoint
Database Checkpoint
Text Checkpoint

What's contained in the Test Script ?

Test Script contained the Test Script Language.

How do you modify the logical name or the physical description of the objects in GUI map ?

We can modify the logical name or the physical description of the objects through GUI map editor.

What are the Data Driven Test ?

When you want to test your application, you may want to check how it performance same operation with the multiple sets of data.

How do you record a Data Driven Test ?

We can create a Data Driven Test through Flat Files, Data Tables, and Database.

How do you clear a GUI map files ?

We can clear the GUI map files through "CLEAR ALL" option.

What are the steps of creating a Data Driven Test ?

Data Driven Testing have four steps-
Creating test
Converting into Data Driven Test
Run Test
Analyze test

What is Rapid Test Script Wizard ?

It performs two tasks.
a. It systematically opens the windows in your application and learns a description of every GUI object. The wizard stores this information in a GUI map file.
b. It automatically generates tests base on the information it learned as it navigated through the application.

What are the different modes in learning an application under Rapid test script wizard ?

a. Express
b. Comprehensive.

What's the extension of GUI map files ?

GUI map files extension is ".gui".

What statement generated by WinRunner when you check any objects ?

Obj_check_gui statement.

What statement generated by WinRunner when you check any windows ?

Win_check_gui statement

What statement generated by WinRunner when you check any bitmap image over the objects ?

Obj_check_bitmap statement

What statement generated by WinRunner when you check any bitmap image over the windows ?


Win_check_bitmap statement

What statement used by WinRunner in Batch Testing ?

"Call" statement.

Which short key is used to freeze the GUI Spy ?

"Ctrl+F3"

How many types of parameter used by WinRunner ?

WinRunner provides three types of Parameter-
Test
Data Driven
Dynamic

How many types of Merging used by WinRunner ?

WinRunner used two types of Merging-
Auto
Manual

What's the Virtual Objects Wizard ?

Whenever WinRunner is not able to read an objects as an objects then it uses the Virtual Objects Wizard.

How do you handle unexpected events and errors ?

WinRunner uses the Exception Handling function to handle unexpected events and errors.

How do you comment your script ?

We comment script or line of the script by inserting "#" at the beginning of script line.

What's the purpose of the Set_Windows command ?

Set_Window command set the focus to the specified windows.

How you created your test script ?

Programming.

What's a command to invoke application?

Invoke_application

What do you mean by the logical name of objects ?

Logical name of an objects is determined by it's class but in most cases, the logical name is the label that appear on an objects.

How many types of GUI checkpoints ?

In Winrunner, three types of GUI checkpoints-
For Single Properties
For Objects/Windows
For Multiple Objects

How many types of Bitmap Checkpoints ?

In Winrunner, two types of Bitmap Checkpoints-
For Objects/Windows
For Screen Area

How many types of Database Checkpoints ?


In Winrunner, three types of Database Checkpoints-
Default Check
Custom Check
Runtime Record Check

How many types of Text Checkpoints ?

In Winrunner, four types of Text Checkpoints-
For Objects/Windows
From Screen Area
From Selection (Web Only)
Web text Checkpoints

What add-ins are available for WinRunner ?

Add-ins are available for Java, ActiveX, WebTest, Siebel, Baan, Stingray, Delphi, Terminal Emulator, Forte, NSDK/Natstar, Oracle and PowerBuilder.

SQL Testing Information.

Types of Joins:

Joins are one of the most important operations performed by a relational database system. An RDBMS uses joins to match rows from one table with rows from another table. For example, we can use joins to match sales with customers or books with authors. Without joins, we might have a list of sales and customers or books and authors, but we would have no way to determine which customers bought which items or which authors wrote which books.

We can join two tables explicitly by writing a query that lists both tables in the FROM clause. We can also join two tables by using a variety of different sub-queries. Finally, SQL Server may introduce joins for a variety of purposes into a query plan during optimization.

This is the first of several posts that I am planning for joins. In this post, I’m going to start by introducing the logical join operators that SQL Server supports. These are:

While different implementations have many ways of joining tables, you concentrate on the most common joins in this lesson. The types of joins that you learn are

  • EQUIJOINS( Inner join)
  • NATURAL JOINS
  • NON-EQUIJOINS
  • Using Table Aliases
  • OUTER JOINS
  • SELF JOINS
  • Cross join
  • Cross apply
  • Semi-join
  • Anti-semi-join

Here is a simple schema and data set that I will use to illustrate each join type:

create table Customers (Cust_Id int, Cust_Name varchar(10))

insert Customers values (1, 'Craig')

insert Customers values (2, 'John Doe')

insert Customers values (3, 'Jane Doe')

create table Sales (Cust_Id int, Item varchar(10))

insert Sales values (2, 'Camera')

insert Sales values (3, 'Computer')

insert Sales values (3, 'Monitor')

insert Sales values (4, 'Printer')

Inner joins

Perhaps the most used and important of the joins is the EQUIJOIN, also referred to as an INNER JOIN. The EQUIJOIN joins two tables with a common column in which each is usually the primary key.

The syntax for an EQUIJOIN is

SELECT TABLE1.COLUMN1, TABLE2.COLUMN2...
FROM TABLE1, TABLE2 [, TABLE3 ]
WHERE TABLE1.COLUMN_NAME = TABLE2.COLUMN_NAME
[ AND TABLE1.COLUMN_NAME = TABLE3.COLUMN_NAME ]

NOTE

Inner joins are the most common join type. An inner join simply looks for two rows that put together satisfy a join predicate. For example, this query uses the join predicate “S.Cust_Id = C.Cust_Id” to find all Sales and Customer rows with the same Cust_Id:

select *

from Sales S inner join Customers C

on S.Cust_Id = C.Cust_Id

Cust_Id Item Cust_Id Cust_Name

----------- ---------- ----------- ----------

2 Camera 2 John Doe

3 Computer 3 Jane Doe

3 Monitor 3 Jane Doe

Notes:

  • Cust_Id 3 bought two items so this customer row appears twice in the result.
  • Cust_Id 1 did not purchase anything and so does not appear in the result.
  • We sold a ‘Printer’ to Cust_Id 4. There is no such customer so this sale does not appear in the result.

Inner joins are fully commutative. “A inner join B” and “B inner join A” are equivalent.

Natural Joins

A NATURAL JOIN is nearly the same as the EQUIJOIN; however, the NATURAL JOIN differs from the EQUIJOIN by eliminating duplicate columns in the joining columns. The JOIN condition is the same, but the columns selected differ.

The syntax is as follows:

SELECT TABLE1.*, TABLE2.COLUMN_NAME
    [ TABLE3.COLUMN_NAME ]
FROM TABLE1, TABLE2 [ TABLE3 ]
WHERE TABLE1.COLUMN_NAME = TABLE2.COLUMN_NAME
[ AND TABLE1.COLUMN_NAME = TABLE3.COLUMN ]

Look at the following example:

SELECT EMPLOYEE_TBL.*, EMPLOYEE_PAY_TBL.SALARY
FROM EMPLOYEE_TBL,
   EMPLOYEE_PAY_TBL
WHERE EMPLOYEE_TBL.EMP_ID = EMPLOYEE_PAY_TBL.EMP_ID;

This SQL statement returns all columns from EMPLOYEE_TBL and SALARY from the EMPLOYEE_PAY_TBL. The EMP_ID is in both tables, but is retrieved only from the EMPLOYEE_TBL because both contain the same information and do not need to be selected.

The following example selects all columns from the EMPLOYEE_TBL table and only one column from the EMPLOYEE_PAY_TBL table. Remember that the asterisk (*) represents all columns of a table.

SELECT EMPLOYEE_TBL.*, EMPLOYEE_PAY_TBL.POSITION
FROM EMPLOYEE_TBL, EMPLOYEE_PAY_TBL
WHERE EMPLOYEE_TBL.EMP_ID = EMPLOYEE_PAY_TBL.EMP_ID;
EMP_ID     LAST_NAM FIRST_NA M ADDRESS          CITY         ST  ZIP  PHONE
---------- -------- -------- - -------------   ------------  -- ----- ----------
PAGER      POSITION
---------- --------------
311549902  STEPHENS TINA     D  RR 3 BOX 17A    GREENWOOD    IN 47890 3178784465
           MARKETING
 
442346889  PLEW     LINDA    C  3301 BEACON     INDIANAPOLIS IN 46224 3172978990
           TEAM LEADER
 
213764555 GLASS    BRANDON S 1710 MAIN ST    WHITELAND    IN 47885 3178984321
3175709980 SALES MANAGER
 
313782439 GLASS    JACOB       3789 RIVER BLVD INDIANAPOLIS IN 45734 3175457676
8887345678 SALESMAN
 
220984332  WALLACE  MARIAH      7889 KEYSTONE   INDIANAPOLIS IN 46741 3173325986
           SHIPPER
 
443679012  SPURGEON TIFFANY     5 GEORGE COURT  INDIANAPOLIS IN 46234 3175679007
           SHIPPER

6 rows selected.

NOTE

Notice how the output has wrapped in the previous example. The wrap occurred because the length of the line has exceeded the limit for the line (which is usually 80 characters per line by default).

Using Table Aliases

The use of table aliases means to rename a table in a particular SQL statement. The renaming is a temporary change. The actual table name does not change in the database. As you will learn later in this hour, giving the tables aliases is a necessity for the SELF JOIN. Giving tables aliases is most often used to save keystrokes, which results in the SQL statement being shorter and easier to read. In addition, fewer keystrokes means fewer keystroke errors. Also, programming errors are typically less frequent if you can refer to an alias, which is often shorter in length and more descriptive of the data with which you are working. Giving tables aliases also means that the columns being selected must be qualified with the table alias. The following are some examples of table aliases and the corresponding columns:

SELECT E.EMP_ID, EP.SALARY, EP.DATE_HIRE, E.LAST_NAME
FROM EMPLOYEE_TBL E,
   EMPLOYEE_PAY_TBL EP
WHERE E.EMP_ID = EP.EMP_ID
AND EP.SALARY > 20000;

The tables have been given aliases in the preceding SQL statement. The EMPLOYEE_TBL has been renamed E. The EMPLOYEE_PAY_TBL has been renamed EP. The choice of what to rename the tables is arbitrary. The letter E is chosen because the EMPLOYEE_TBL starts with E. Because the EMPLOYEE_PAY_TBL also begins with the letter E, you could not use E again. Instead, the first letter (E) and the first letter of the second word in the name (PAY) are used as the alias. The selected columns were justified with the corresponding table alias. Note that SALARY was used in the WHERE clause and must also be justified with the table alias.

Joins of Non-Equality

NON-EQUIJOIN joins two or more tables based on a specified column value not equaling a specified column value in another table. The syntax for the NON-EQUIJOIN is

FROM TABLE1, TABLE2 [, TABLE3 ]
WHERE TABLE1.COLUMN_NAME != TABLE2.COLUMN_NAME
[ AND TABLE1.COLUMN_NAME != TABLE2.COLUMN_NAME ]

Cross joins

A cross join performs a full Cartesian product of two tables. That is, it matches every row of one table with every row of another table. You cannot specify a join predicate for a cross join using the ON clause though you can use a WHERE clause to achieve essentially the same result as an inner join.

Cross-joins are fairly uncommon. Two large tables should never be cross joined as this will result in a very expensive operation and a very large result set.

select *

from Sales S cross join Customers C

Cust_Id Item Cust_Id Cust_Name

----------- ---------- ----------- ----------

2 Camera 1 Craig

3 Computer 1 Craig

3 Monitor 1 Craig

4 Printer 1 Craig

2 Camera 2 John Doe

3 Computer 2 John Doe

3 Monitor 2 John Doe

4 Printer 2 John Doe

2 Camera 3 Jane Doe

3 Computer 3 Jane Doe

3 Monitor 3 Jane Doe

4 Printer 3 Jane Doe

Cross apply

We introduced cross apply in SQL Server 2005 to enable joins with a table valued function (TVF) where the TVF has a parameter that changes for each execution. For example, the following query returns the same result as the above inner join using a TVF and cross apply:

create function dbo.fn_Sales(@Cust_Id int)

returns @Sales table (Item varchar(10))

as

begin

insert @Sales select Item from Sales where Cust_Id = @Cust_Id

return

end

select *

from Customers cross apply dbo.fn_Sales(Cust_Id)

Cust_Id Cust_Name Item

----------- ---------- ----------

2 John Doe Camera

3 Jane Doe Computer

3 Jane Doe Monitor

We can also use outer apply to find all Customers regardless of whether they purchased anything. This is similar to an outer join.

select *

from Customers outer apply dbo.fn_Sales(Cust_Id)

Cust_Id Cust_Name Item

----------- ---------- ----------

1 Craig NULL

2 John Doe Camera

3 Jane Doe Computer

3 Jane Doe Monitor

Semi-join and Anti-semi-join

A semi-join returns rows from one table that would join with another table without performing a complete join. An anti-semi-join returns rows from one table that would not join with another table; these are the rows that would be NULL extended if we performed an outer join.

Unlike the other join operators, there is no explicit syntax to write “semi-join,” but SQL Server uses semi-joins in a variety of circumstances. For example, we may use a semi-join to evaluate an EXISTS sub-query:

select *

from Customers C

where exists (

select *

from Sales S

where S.Cust_Id = C.Cust_Id

)

Cust_Id Cust_Name

----------- ----------

2 John Doe

3 Jane Doe

Unlike the previous examples, the semi-join only returns each customer one time.

The query plan shows that SQL Server indeed uses a semi-join:

|--Nested Loops(Left Semi Join, WHERE:([S].[Cust_Id]=[C].[Cust_Id]))
|--Table Scan(OBJECT:([Customers] AS [C]))
|--Table Scan(OBJECT:([Sales] AS [S]))

There are left and right semi-joins. A left semi-join returns rows from the left (first) input that match rows from the right (second) input while a right semi-join returns rows from the right input that match rows from the left input.

We might similarly use an anti-semi-join to evaluate a NOT EXISTS sub-query.

Miscellaneous notes

In all of the above examples, I used a join predicate that compares whether two columns, one from each table, are equal. This type of join predicate is called an “equijoin.” Other join predicates (such as inequalities) are possible, but equijoins are especially common and SQL Server has many more alternatives when optimizing equijoins than when optimizing joins with more complex predicates.

SQL Server has more flexibility over join order and algorithms when optimizing inner joins than when optimizing outer joins and cross applies. Thus, given two queries that differ only in that one strictly uses inner joins while the other uses outer joins and/or cross applies, SQL Server may be able to find a better plan for the query that uses inner joins only.

Read More about Software Testing Tutorials

Saturday, March 15, 2008

Bug Report Guidelines

Status:
When you are logging the bug in any bug tracking system then by default the bug status is ‘New’.
Later on bug goes through various stages like Fixed, Verified, Reopen, Won’t Fix etc.
Click here to read more about detail bug life cycle.

Assign To:
If you know which developer is responsible for that particular module in which bug occurred, then you can specify email address of that developer. Else keep it blank this will assign bug to module owner or Manger will assign bug to developer. Possibly add the manager email address in CC list.

URL:
The page url on which bug occurred.

Summary:
A brief summary of the bug mostly in 60 or below words. Make sure your summary is reflecting what the problem is and where it is.

Description:
A detailed description of bug. Use following fields for description field:

  • Reproduce steps: Clearly mention the steps to reproduce the bug.
  • Expected result: How application should behave on above mentioned steps.
  • Actual result: What is the actual result on running above steps i.e. the bug behavior.

These are the important steps in bug report. You can also add the “Report type” as one more field which will describe the bug type.

The report types are typically:
1) Coding error
2) Design error
3) New suggestion
4) Documentation issue
5) Hardware problem

Some Bonus tips to write a good bug report:

1) Report the problem immediately:If you found any bug while testing, do not wait to write detail bug report later. Instead write the bug report immediately. This will ensure a good and reproducible bug report. If you decide to write the bug report later on then chances are high to miss the important steps in your report.

2) Reproduce the bug three times before writing bug report:Your bug should be reproducible. Make sure your steps are robust enough to reproduce the bug without any ambiguity. If your bug is not reproducible every time you can still file a bug mentioning the periodic nature of the bug.

3) Test the same bug occurrence on other similar module:
Sometimes developer use same code for different similar modules. So chances are high that bug in one module can occur in other similar modules as well. Even you can try to find more severe version of the bug you found.

4) Write a good bug summary:
Bug summary will help developers to quickly analyze the bug nature. Poor quality report will unnecessarily increase the development and testing time. Communicate well through your bug report summary. Keep in mind bug summary is used as a reference to search the bug in bug inventory.

5) Read bug report before hitting Submit button:
Read all sentences, wording, steps used in bug report. See if any sentence is creating ambiguity that can lead to misinterpretation. Misleading words or sentences should be avoided in order to have a clear bug report.

6) Do not use Abusive language:
It’s nice that you did a good work and found a bug but do not use this credit for criticizing developer or to attack any individual.

Conclusion:
No doubt that your bug report should be a high quality document. Focus on writing good bug reports, spend some time on this task because this is main communication point between tester, developer and manager. Mangers should make aware to their team that writing a good bug report is primary responsibility of any tester. Your efforts towards writing good bug report will not only save company resources but also create a good relationship between you and developers.


Read More about Software Testing Tutorials