Friday, November 25, 2011

== Software Testing Concepts ==

Following should be the pre-requisite to start automation:

1. Build should be stable.
2. Functionalities should be getting repeated.
3. Test cases, which can be automated, should be filtered.
4. Generally after third or fourth release of the application.



Entry & Exit criteria is part of test plan document:

Entry Criteria: Use to determine that test plan is ready to execute 

1. Setup test environment that is required for particular test plan.
2. S/W or application has been installed successfully.
3. All required / specified per-requisite are there.

Exit Criteria: Use to determine that it is the time to stop testing like


1. All major functionalists have been cover as specify in test plan.
2. All test cases are completely executed or not.
3. S/W or application is bug free (up to 80%) and no higher priority 
or higher severity bug in application. 
4. All the documents should be reviewed, finalized or signed off.



Integration testing test cases:- 


Integration testing is done to ensure that the modules are integrated properly and to check the communication between modules 

:-- So to write the test cases 
:-- Simply enter the values in the Mandatory fields and Click the Submit/Login buttons.

here we don't fill the values in each and every text box.. we simply enter values in all of the required fields and will click on the button to check the modules are corrected or not.


Tuesday, October 18, 2011

Windows System Parameters for the Keyboard UI.


The Windows operating system supports many system parameters that share the system-wide option settings between applications and the system itself. Applications can access the system-wide settings by calling the SystemParametersInfo function with the specific SPI values.

Applications that use the settings must watch for the WM_SETTINGSCHANGE message to respond or adjust configurations adequately.

There are many keyboard UI-related system parameters available in the operating system. Many of the system parameter values have read and write procedures through the API, although an application usually only reads those settings because most of the system parameters are controlled through Control Panel. System parameters and their corresponding API names and descriptions are shown in the following table.



Keyboard UI–Related System Parameters

System parametersSPI valuesDescription
Keyboard PreferenceSPI_GETKEYBOARDPREFGet settings for a user's keyboard interface preference.
Access Key UnderlinesSPI_GETKEYBOARDCUESGet settings for underline of access keys.
SPI_GETMENUUNDERLINESGet settings for underline of access keys.
Focus Rectangle BorderSPI_GETFOCUSBORDERHEIGHTGet settings for focus border height.
SPI_GETFOCUSBORDERWIDTHGet settings for focus border width.
Cursor WidthSPI_GETCARETWIDTHGet settings for system cursor width.
Windows Accessibility Options and Keyboard Repeat RatesSPI_GETFILTERKEYSGet settings for FilterKeys options.
SPI_GETMOUSEKEYSGet settings for MouseKeys options.
SPI_GETSTICKYKEYSGet settings for StickyKeys options.
SPI_GETTOGGLEKEYSGet settings for ToggleKeys options.
SPI_GETKEYBOARDDELAYGet settings for delay time of key inputs.
SPI_GETKEYBOARDSPEEDGet settings for repeat rate of key inputs.
TooltipsSPI_GETMOUSEHOVERTIMEGet settings for delay time to display tooltips.


Note  SPI_GETSERIALKEYS is not listed here because it is only supported in earlier Windows platforms. The input from serial key devices must be received by applications in the same manner as those from standard keyboard or mouse input devices.

About the Keyboard Preference Flag

An application that normally hides some keyboard UI elements or omits some keyboard mechanisms altogether must present them when the keyboard preference flag (SPI_GETKEYBOARDPREF) is set. The flag, which is set by the user in Control Panel, advises an application that the user relies on the keyboard rather than a mouse, so additional support must be provided when appropriate.

Additional Resources

For more information about UI design and development, see User Interface and Microsoft Windows User Experience (Microsoft Press; ISBN: 0-7356-0566-1).

For more information about assistive technology products, see Assistive Technology Products.

Windows Shortcut Keys

As noted in the Designing the Keyboard UI section, it is important for applications to be consistent with other applications when using shortcut keys. This section introduces a series of shortcut keys that are used in Windows. To be consistent with other Windows-based applications, it is recommended that you map shortcut keys in a similar way.

For more information, see General Shortcut Keys for Applications.

Note  This section is an overview of commonly used shortcut keys. If you are connected to Windows through Microsoft Terminal Services Client, some shortcuts may have changed depending on your configuration. Some keyboard shortcuts may require Microsoft Natural Keyboard or another compatible keyboard that includes the Windows logo key.


System-Wide Shortcut Keys

PressTo
ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).pngDisplay or hide the Start menu.
CTRL+ESCDisplay or hide the Start menu (same as ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png).
CTRL+ALT+DELETEDisplay Windows Security screen or Windows Task Manager.
ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png+BSet focus on a notification.
ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png+DShow the desktop.
ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png+EOpen My Computer by Windows Explorer.
ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png+FSearch for a file or folder.
CTRL+ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png+FSearch for computers.
ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png+GToggle through Sidebar gadgets (new with Windows Vista).
ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png+PToggle through the projection mode (new with Windows 7).
ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png+LLock your computer if you are connected to a network domain, or switch users if you are not connected to a network domain.
ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png+MMinimize all windows.
ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png+SHIFT+MRestore minimized windows.
ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png+ROpen the Run dialog box.
ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png+TSet focus to the taskbar.
ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png+DOWN ARROWUn-maximize/minimize window (new with Windows 7).
ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png+UP ARROWMaximize window.
ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png+RIGHT|LEFT ARROWDock/undock window to the right or left of the desktop.
ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png+SHIFT+RIGHT|LEFT ARROWMove window among the desktops (available with Windows 7 installed with more than one monitor).
ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png+SPACEPeek at gadgets. Hold down the ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png key to hold the state (new with Windows 7).
ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png+numberLaunch or toggle between applications on the taskbar (new with Windows 7).
ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png+F1Display Windows Help.
ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png+BREAKDisplay the System Properties dialog box.
ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png+TABSwitch between open windows (new with Windows Vista).
ALT+TAB(s)Switch between open windows. While holding the ALT key down, you can press TAB several times to navigate through the system display of each previously used window.
ALT+SHIFT+TAB(s)Similar to ALT+TAB(s), switch backward between open windows. You can switch between moving backward or forward by holding or releasing SHIFT key.
ALT+ESC(s)Cycle the input focus through the windows in the order that they were opened; compare to ALT+TAB.
ALT+SHIFT+ESC(s)Similar to ALT+ESC(s), cycle focus backward through windows. You can switch between moving backward or forward by holding or releasing the SHIFT key.
PRINTSCREENCopy an image of the screen.
ALT+PRINTSCREENCopy an image of the current window.
Left ALT+SHIFTSwitch input languages or keyboard layouts (available and configurable when the user installed multiple keyboard layouts through Regional and Language Options in Control Panel).
CTRL+SHIFTSwitch keyboard layouts or input languages (available and configurable when the user installed multiple keyboard layouts through Regional and Language Options in Control Panel).
CTRL or left ALT+SHIFT + ~, number (0~9), or grave accent keyHot key for input languages (available and configurable when the user installed multiple keyboard layouts through Regional and Language Options in Control Panel).


System-Wide Accessibility Options and Tools Shortcut Keys

Note  This section does not list all keyboard shortcuts offered by accessibility tools. For more information about keyboard shortcuts offered by a particular accessibility tool, please see the online Help for that tool.

PressTo
Holding right SHIFT for eight secondsSwitch FilterKeys on and off.
Left ALT + left SHIFT+PRINT SCREENSwitch High Contrast on and off.
Left ALT + left SHIFT+NUM LOCKSwitch MouseKeys on and off.
SHIFT five timesSwitch StickyKeys on and off.
Holding NUM LOCK for five secondsSwitch ToggleKeys on and off.
ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png+U
Open Utility Manager or Ease of Access Center.
ms971323.atg_keyboardshortcuts_11(en-us,MSDN.10).png+"+"
Launch Magnifier or increase the magnification (new with Windows 7).

General Shortcut Keys for Applications

PressTo
F1Display Application Help.
SHIFT+F1Display tips help (context-sensitive help) near the selected control.
ms971323.atg_keyboardshortcuts_10(en-us,MSDN.10).pngDisplay the shortcut menu for the selected item.
SHIFT+F10Display the shortcut menu for the selected item (same as ms971323.atg_keyboardshortcuts_10(en-us,MSDN.10).png).
CTRL+CCopy selected items.
CTRL+XCut selected items.
CTRL+VPaste, cut or copied items.
CTRL+ZUndo the last action.
CTRL+YRedo the last action.
ESCCancel the current task.
DELETEDelete selected items.

Navigation and Window Controls Shortcut Keys

PressTo
CTRL+F4Close the active document in applications that allow you to have multiple documents open simultaneously.
ALT+F4Close the active item, or quit the active application.
CTRL+TABMoves to next pane or palette.
CTRL+SHIFT+TABMoves to previous pane or palette.
F6Moves to next pane or palette (same as CTRL+TAB).
SHIFT+F6Moves to previous pane or palette (same as CTRL+SHIFT+TAB).
CTRL+F6Moves to next window in a group of related windows (or between MDI document windows).
CTRL+SHIFT+F6Moves to previous window in a group of related windows (or between MDI document windows).

Menu Controls Shortcut Keys

PressTo
ALT+SPACEDisplay shortcut menu for the active window.
ALT+"-" (Hyphen)Display shortcut menu for the active child window (MDI application).
ALTActivate the menu bar and enter menu mode.
F10Activate the menu bar and enter menu mode (same as ALT).
ALT+(access keys on menu or dialog box selected)Activate the menu bar and open corresponding menu to the access key.
Access key[Menu mode] Carry out the corresponding command.
DOWN ARROW[Menu mode] Open menu item, move to the one item below, or move to top of menu if focus is located in the bottom of the menu.
UP ARROW[Menu mode] Move to the one menu item above, or move to the bottom if focus is located in the top of the menu.
RIGHT ARROW[Menu mode] Open the next menu to the right, or open a submenu.
LEFT ARROW[Menu mode] Open the next menu to the left, or close a submenu.


Edit Box Shortcut Keys

PressTo
HOMEMove cursor to beginning of the line.
ENDMove cursor to end of the line.
CTRL+ASelect all.
CTRL + RIGHT or LEFT ARROWMove cursor to the beginning of the next or previous word.
CTRL + DOWN or UP ARROWMove cursor to the beginning of the next or previous paragraph.
CTRL+HOMEMove cursor to the top of the document.
CTRL+ENDMove cursor to the end of the document.
Holding SHIFT + cursor movement (arrow, HOME, or END keys)Select or extend the selection.
Holding SHIFT + CTRL + Cursor movementSelect or extend the selection by words or block of text.
INSERTToggle the insertion mode.

Dialog Box and Common Controls Shortcut Keys

Note  Arrow keys, PAGE UP or PAGE DOWN, HOME, and END keys for general navigation are omitted from the next table.

Control typePressTo
GeneralTABMove forward through options.
SHIFT+TABMove backward through options.
Dialog boxALT+access keySelect or carry out the corresponding command or control.
ENTERCarry out the default command of the dialog box or command of the selected control.
SPACEToggle the selection status or carry out the selected option or control command.
Arrow keysMove focus or selection in a group of controls or items.
Tab controlCTRL + TABMove forward through tabs.
CTRL + SHIFT+TABMove backward through tabs.
CTRL + PAGE DOWNMove forward through tabs (same as CTRL+TAB).
CTRL + PAGE UPMove backward through tabs (same as CTRL+SHIFT+TAB).
Arrow keysMove between tabs when focusing on the control.
Combo boxF4Display or hide the items in the active list.
ALT + DOWN or UPDisplay or hide the items in the active list (same as F4).
Any printable key or keysMoves the selection to the item matching prefix letters in the beginning of title. For more information, seeNavigating by Matching Characters.
List viewSPACELocates new selection and anchor for the item.
SHIFT+SPACEExtends the selection from anchor to the item.
CTRL+SPACEInvoke additional selection or deselection and move the anchor to the selected item.
Arrow keysMove focus and remove all selection and the anchor previously made.
CTRL+arrow keysMove focus without move of selection or the anchor.
Any printable key or keysMoves the selection to the item matching prefix letters in the beginning of the label. For more information, seeNavigating by Matching Characters.
CTRL + "+" (numeric pad)Adjusts the width of all columns to fit their contents.
Header (where keyboard focus is supported)RIGHT/LEFTMove selection of the header right and left.
CTRL+SHIFT+RIGHT/LEFTAdjust the width of the selected header.
CTRL+ALT+RIGHT/LEFTMove the selected header right and left.
SPACE[Windows Explorer] Toggle the sort condition of the selected header.
DOWN ARROW[Windows Explorer] Open more options for the selected header.
Tree view* (Numpad)Display all sub-items under the selected item.
+ (Numpad)Display sub-items directly under the selected item.
- (Numpad)Collapse the items directly under the selected item group.
RIGHT ARROWDisplay sub-items directly under the selected item (same as +).
LEFT ARROWCollapse the selected item group and move focus to the group leaf root.
CTRL+UP ARROWScroll the view without change of the selection.
CTRL+DOWN ARROWScroll the view without change of the selection.
Any printable key or keysMoves the selection to the item matching prefix letters in the beginning of title. For more information, seeNavigating by Matching Characters.
Date and time pickerF4Display calendar below the control.
ALT+DOWNDisplay calendar below the control.
ALT+UPHide calendar below the control.
PAGE UPMove to next month in the calendar.
PAGE DOWNMove to previous month in the calendar.
CTRL+PAGE UPMove to next year in the calendar.
CTRL+PAGE DOWNMove to previous year in the calendar.
Check boxSPACEToggles the selected option.
-Clear the option.
+Select the option.
SliderArrow keysMove the slider to the next value. The direction can be reversed by selecting the slider control style LBS_DOWNISLEFT.
PAGE UP and DOWNMove the slider to next value in specified incremental amount. The direction can be reversed by selecting the slider control style LBS_DOWNISLEFT.

Windows Explorer Shortcut Keys

Note  The shortcut keys in the next table are presented only as examples and do not represent all of the available shortcut keys.

PressTo
F2Rename selected item.
F3Search for a file or folder.
F4Display the Address bar list.
F5Refresh the active window or reload document in the active window.
F6Cycle through screen elements in a window or on the desktop.
ALT+RIGHT ARROWMove to next page or folder viewed.
ALT+LEFT ARROWMove to previous or folder viewed.
ALT+ENTERView properties for the selected item.
SHIFT+DELETEDelete selected item permanently without placing the item in the Recycle Bin.
HOMEDisplay the top of the active window.
ENDDisplay the bottom of the active window.
BACKSPACEView the folder one level up.

Microsoft Office XP Shortcut Keys

Note  The shortcut keys in the next table are presented only as examples and do not represent all of the available shortcut keys. A complete list of shortcut keys is provided in the online documentation of each Microsoft Office application.

PressTo
INSERTToggle the insertion mode.
F6Move between task pane and the document window.
SHIFT+F6Move backward between task pane and the document window.
CTRL+F6Switch to next window, when more than one window is open.
CTRL+SHIFT+F6Switch backward to next window, when more than one window is open.
CTRL+TABMove focus between menu and tool bars in menu mode.
F1Displays the Assistant balloon (if Office Assistant is turned on).
ALT+SHIFT+F10Displays the menu or message for a Smart Tag near the input focus.
CTRL + OOpens the Open dialog box.
CTRL + NOpens a new blank document.
CTRL + FOpens the Find dialog box.
CTRL + POpens the Print dialog box.
CTRL + SSaves the document that currently has the input focus.
CTRL + ASelect all.

Saturday, August 20, 2011

Directory Structure For Software Automation Testing Project


Index:
  1. Common Directory Structure  - Automation Frame Work for the AutoIT Project
  2. Naming Convention
  3. Coding Convention
  4. Proper Comments
  5. Write proper precondition
Common Directory Structure  - Automation Frame Work for the AutoIT Project:




Note : Release Notes folder, where .doc file is included.

Naming Convention:
There is Naming Convention which are follows in the project.


Name of the variables
     For example:

Counter name (Write full description like “PASS instead of P / FAIL instead of F”)

Coding Convention:
Name of the Functions

     SC_NameOfTheRelatedScenario (Functions, which are placed in Scenariowise)
     TC_NameOfTheRelatedActivity (Functions, which are placed in TestCasewise)

In Conditional Statement, Variable Name is like, this
     <Name of Action_RowIncr / Name of Action_ColumnIncr>
       

      for(Cost_RowIncreament=0;Cost_RowIncreament<=5;Cost_RowIncreament++)
            {

            }
      instead of           

      for(i=0;i<=5;i++)
            {
            }

Comments:
     There are very importent to write proper comments at the time of making test script
     Comments are two types:
        Single line comments
        Multiple line comments (Block level)



Precondition: 
     Precondition is very important to reaches our goal with the help of reproduction steps





Some performance testing code for autoit tool to desktop based application testing:


1. CPU Utilization
2. Memory Usage
3. Time Taken



   $log = FileOpen(@WorkingDir & "\." & ".\result\Result_PSoC_CPU&MemoryUsage.log", 1)
   $logs = FileOpen(@WorkingDir & "\." & ".\result\Result_PSoC_TimeoutError.log", 1)
   
      #include <Excel.au3>
      #include <File.au3>
      #include <array.au3>
   
 for $i = 1 to 120 Step +1


  If $i == 1 Then
  
   Sleep(3000)
   Run($CmdLine[1])
   Sleep(3000)
   Run(@WorkingDir & "\." & ".\bin\SC_demoScripts\TC_drag&Drop.exe")


   Local $cpuincrement = 0
   Local $memincrement = 0
   Local $cpu = 0
   Local $cpu1 = 0
   Local $mem = 0
   Local $mem1 = 0
   Local $total = MemGetStats()
   Local $array = ProcessList("TC_drag&Drop.exe")
   Local $iPID = $array[1][1]
   Local $sProcess = $iPID
   
   for $j = 1 to 120 step +1
    
    if ProcessExists("TC_drag&Drop.exe") Then
     Local $load = Process($sProcess, 300 )
     Sleep(1000)
     
     if $load > 0 Then
      $cpu = $cpu + $load
      $cpuincrement = $cpuincrement + 1
     EndIf
     
     $mem1 = ProcessGetStats("TC_drag&Drop.exe",0)
     $mem = $mem + $mem1[1]
     $memincrement = $memincrement + 1
     
    EndIf
    
   Next
  
   if $memincrement >= 120 then
    Sleep(2000)
    ProcessClose("TC_drag&Drop.exe")
    Sleep(2000)
    ProcessClose("PSoC Creator 2.0.exe") 
    FileWriteLine($logs,"Timeout Error in TC_drag&Drop Script Execution.")
   EndIf
   
   if $cpu <> 0 Then
    $cpu = Round($cpu/$cpuincrement,2)
   EndIf

  $mem = Round((($mem/1048576)/$memincrement),2) 
  FileWriteLine($log, "                 ")
  FileWriteLine($log,"+++++ Cypress_PSoCreator +++++")
  FileWriteLine($log,"                  ")
  FileWriteLine($log,"***** Cypress_PSoCreator *****")
  FileWriteLine($log,"Process Name: "&$array[1][0])
  FileWriteLine($log,"Process PID: "&$array[1][1])
  
  Global $sFilePath1 = @WorkingDir & "\." & ".\result\Result_PSoC_Creator.xls"
  Global $oExcel1 = _ExcelBookAttach($sFilePath1)
  
   if $cpu <> 0 Then
    FileWriteLine($log,"Average CPU Usage In Percentage: "&$cpu&" %")
    _ExcelWriteCell($oExcel1, $cpu, 3, 4)
   EndIf
   if $cpu == 0 Then
    FileWriteLine($log,"Average CPU Usage In Percentage: "&$cpu1&" %")
    _ExcelWriteCell($oExcel1, $cpu1, 3, 4)
   EndIf
  
  FileWriteLine($log,"Total Physical RAM In MB: "&Round($total[1]/1024,2)&" MB")
  _ExcelWriteCell($oExcel1, Round($total[1]/1024,2), 3, 7)
  FileWriteLine($log,"Average Memory Usage In MB: "&$mem&" MB")
  _ExcelWriteCell($oExcel1, $mem, 3, 5)
  _ExcelBookClose($oExcel1, 1, 0) 
  
 EndIf

 Next
  
  FileClose($logs)
  FileClose($log)


 Func Process($strProcess = "Idle", $iSampleTime = 500, $sComputerName = @ComputerName)
  
  if $strProcess = "" then $strProcess = "Idle"
  if $iSampleTime = "" AND IsString($iSampleTime) then $iSampleTime = 500
  if $sComputerName = "" then $sComputerName = @ComputerName
    
   if not IsDeclared("iP1") AND $iSampleTime = 0 then
    $bFirstTimeInLoopMode = 1
   else
    $bFirstTimeInLoopMode = 0
   endif
    
   if not IsDeclared("iP1") then
    assign("iP1", 0, 2) 
    assign("iT1", 0, 2)
   endif
    
  $objWMIService = ObjGet("winmgmts:\\" & $sComputerName & "\root\CIMV2")
  if @error then return -2
  
   if number($strProcess) then 
    $strProcess = " WHERE IDProcess = '" & $strProcess & "'"
   else 
    $strProcess = " WHERE Name = '" & $strProcess & "'"
   endif


  if $iSampleTime OR $bFirstTimeInLoopMode = 1 then
        
        $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_PerfRawData_PerfProc_Process" & $strProcess)
        
 For $objItem In $colItems
            
            $iT1 = $objItem.TimeStamp_Sys100NS
            $iP1 = $objItem.PercentProcessorTime
 next


        if  $objItem = "" then return -1
        sleep($iSampleTime)
  endif
    
  $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_PerfRawData_PerfProc_Process" & $strProcess)


    For $objItem In $colItems
        $iP2 = $objItem.PercentProcessorTime
        $iT2 = $objItem.TimeStamp_Sys100NS  
    next


  if  $objItem = "" then return -1
   
  $iPP = ($iP2 - $iP1)
  $iTT = ($iT2 - $iT1)
  
  if $iTT = 0 Then return 100


  $iCPU = round( ($iPP/$iTT) * 100, 0)
  
  $iP1 = $iP2
  $iT1 = $iT2
  Return $iCPU
  
 EndFunc