9:55 PM

Automate Windows Command Prompt : Telnet Login

The Below Function lets you Login to any Telnet Server  and then Exit. You can Enter the Commands that you would like to run, enter in between the login and exit code. There is a lot of care to be taken for syncronization. You will see a lot of Loops and Call Waits, Which is required for the syncronization. 

Note: You will Need to Add the Telnet Window in your Object Repository.This object needs to use the regular expression for the property ‘regexpwndtitile’ so that the telnet window object can be applied to any telnet instance


'Fucntion Call 
Func_Telnet "10.31.77.67","root","emclegato”,”Linux” 

'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
' Name                 :           Func_Telnet
'Purpose               :           Telnet Login 
‘Pre-Condition    :           Telnet service should be up & running in the Server 
'Parameters        :           sServer - Server Name/IP eg. '10.31.77.207'
'                                                               sLoginID  - Server Telnet Login ID eg. 'root'
'                                                               sLoginPwd - Server Telnet Login Password eg. password'
'                                                               sOSType -  Server OS Type : Windows / Linux / AIX  eg. "Linux"
'Return Value      : Nil
'Usage                   : Func_Telnet sServer, sLoginID, sLoginPwd, sOSType
'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Function Func_Telnet(sServer, sLoginID, sLoginPwd, sOSType)
            Dim i, Str
                        
            'Open Telnet Window using the Server Address
            SystemUtil.Run "telnet",sServer,"C:\",""

            If   Window("TelnetWindow").Exist Then
                        Reporter.ReportEvent micPass, "Verify Telnet Window is Displayed", "Telnet Window is Displayed Successfully"
            Else
                        Reporter.ReportEvent micFail, "Verify Telnet Window is Displayed", "Telnet Window is NOT Displayed"
                        Exit Function 
            End If
            
            'Activate Telnet Window
            Window("TelnetWindow").Activate

            Call Wait(10)
            
            'Error Handling -  Incase the Server does  not have the telnet service running or Incasethe Server reponse is slow
             Str =  Window("TelnetWindow").GetVisibleText
             i = 0     ' This is a counter to Check the Number of Iteration of the Loop
             
            Do While (Instr(Str, "Connecting to") > 0)
                        If i <>
                                    msgbox Str
                                    Call Wait(60) ' Wait for connecting to server
                                    If Window("TelnetWindow").Exist(1) Then
                                                Str =  Window("TelnetWindow").GetVisibleText
                                    Else
                                                Reporter.ReportEvent micFail, "Verify the Telnet window is Connected", "Telnet Window was not able to connect to the Server"
                                                Exit Function
                                    End If
                        Else
                           Reporter.ReportEvent micFail, "Verify the Telnet window is Connected", "Telnet Window was not able to connect to the Server"
                                    Exit Function
                        End If
                        i = i + 1
            Loop

            
            '#Check if the NMC Server OS is Windows           - The Below Code is Specific to Windows System
                        If Lcase(sNMCOSType)="windows"  Then
                                                'Check if - " You are about to send your password information to a remote computer in Internet zone. This might not be safe. Do you want to send anyway(y/n): "- Message is Displayed
                                                Str=""
                                                i=0                    ' This is a counter to Check the Number of Iteration of the Loop
                                                 Do While (Instr(Str,"Do you want to send anyway(y/n):") = 0)
                                                                        If i<10>
                                                                                    'Call Wait As it take some time for the window to display data
                                                                                    Call Wait(2)
                                                                                    Str =  Window("TelnetWindow").GetVisibleText
                                                                        Else
                                                                                    Exit Do 'Exit the Loop if the Counter reaches the Max Count
                                                                        End If
                                                                        i = i+1 'Increment The Counter
                                                Loop
                                                If  (Instr(Str,"Do you want to send anyway(y/n):") = 0) Then
                                                            Reporter.ReportEvent micPass, "Verify Warning Message is Displayed", "Warning Message is Displayed : 'You are about to send your password information to a remote computer in Internet zone. This might not be safe. Do you want to send anyway(y/n): '"
                                                            'Type 'n' & Press Enter
                                                            Window("TelnetWindow").Type "n" & micReturn
                                                Else
                                                            Reporter.ReportEvent micWarning, "Verify Warning Message is Displayed", "Warning Message is NOT Displayed"
                                                End If
                        End If
                        
            '# Below Code is Common to Both Windows / Linux / AIX

            '!!!!!!!!!!!!!!! Login to Server !!!!!!!!!!!!!!!!!!!!!!

            'Check If the 'login:' field is displayed        
            Str=""
            While (Instr(Str,"login:") = 0)
                        Call Wait(2)
                        Str =  Window("TelnetWindow").GetVisibleText
            Wend
            'Enter the Login ID & Press Enter
            Window("TelnetWindow").Type sLoginID & micReturn
            
            'Check If the Password: field is displayed
            Str=""
            While (Instr(Str,"Password:") = 0)
                        Call Wait(2)
                        Str =  Window("TelnetWindow").GetVisibleText
            Wend
            'Enter the Login Password & Press Enter
            Window("TelnetWindow").Type sLoginPwd & micReturn
            
            '#Check if the NMC Server OS is Windows - This Check is done because if the OS Type is Windows we get '>' symbol in the prompt WhereAs in Linux/AIX  we get '#' symbol 
            If Lcase(sNMCOSType)="windows"  Then
                        'Check for the > Prompt - Windows
                        Str=""
                        i=0
                        Do While (Instr(Str,">") = 0)
                                    If i<6>
                                                Call Wait(2)
                                                Str =  Window("TelnetWindow").GetVisibleText
                                    Else
               Exit Do
                                    End If
                                    i=i+1
                        Loop
                        'Verify login was Successful
                If Instr(Str,"Login incorrect") > 0 Then
                                    Reporter.ReportEvent micFail, "Verify login was Successful", "Login was not Successful."
                                    Exit Function
                        Else
                                    Reporter.ReportEvent micPass, "Verify login was Successful", "Login was Successful."
                        End If
            Else
                        'Check for the # Prompt  - Linux / AIX
                        Str=""
                        i=0
                        Do While (Instr(Str,"#") = 0)
                                    If i<6>
                                                Call Wait(2)
                                                Str =  Window("TelnetWindow").GetVisibleText
                                    Else
                                                Exit Do
                                    End If
                                    i=i+1
                        Loop
                        'Verify login was Successful
                         If Instr(Str,"Login incorrect") > 0 Then
                                    Reporter.ReportEvent micFail, "Verify login was Successful", "Login was not Successful."
                                    Exit function
                        Else
                                    Reporter.ReportEvent micPass, "Verify login was Successful", "Login was Successful."
                        End If
            End If

‘!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Exit Telnet Window !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            'Enter exit  & press Enter
            Window("TelnetWindow").Type "exit" & micReturn

            'Check if Telnet window is Closed; Else Wait for 5 Seconds.
            Call Wait (5)
            If Window("TelnetWindow").Exist(3) Then
                        Window("TelnetWindow").Close
                        Call Wait (5)
            End If
            
    'Clear Data
            Set i = Nothing
            Set Str = Nothing
End Function

'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

3:58 AM

HP QTP Overview Presentation

Hp Quick Test Professional
View SlideShare presentation or Upload your own. (tags: qtp my)

3:33 AM

HP Mercury Quick Test Professional 9.5


HP Mercury Quick Test Professional 9.5


 
The New version of QTP has some new features in it. They are :

Improvements to the Installation Process - QTP 9.5 incorporates several improvements to the installation process. The most dramatic change is offering an all-in-one install for all the supported environments delivered on a single DVD. Coupled with an all-in-one license option, this simplifies the installation process considerably. However, the financial implications of such an all-in-one license are still left to be seen (though previous add-in specific licenses will still work).

New Design-Time Panes - QTP 9.5 continues the theme QTP 9.0 established in putting a massive emphasis on smoothing the user experience and reducing the click-per-action ratio. Operations which were once buried under endless sub-menus, or had no automated interface at all, are now placed front-and-center via the new IDE panes. While the new panes do not deliver any new functionality per-se (aside from the Process Guidance pane), they have the potential to dramatically change the way you generate and maintain your code.

The Object Repository - The first difference noticed when the Local object repository or the Repository manager are opened is the new "Checkpoint and Output Objects" branch in the treeview on the left.

Mercury Screen Recorder - Captures your entire run session in a movie clip or capture only the segments with errors, and then view your movie from the Test Results window.

Dynamic Management of Object Repositories- Programmatically manage an action's shared object repository collection during the test run.

For Detail Review of New HP QTP 9.5 - Click Here

10:29 PM

HP QuickTest Professional - Overview


QuickTest Professional, the Mercury automated keyword-driven testing solution. By mirroring end-user behavior, QuickTest Professional creates interactive customizable tests or components that simplify and shorten the testing cycle.

QuickTest Professional enables you to test standard Windows applications, Web objects, ActiveX controls, and Visual Basic applications. You can also test special environments, such as the Java, Oracle, SAP solutions, .NET Windows and Web Forms, Windows Presentation Foundation, Siebel, PeopleSoft, Web services, and terminal emulators, using additional QuickTest add-ins.


QuickTest Professional is Unicode-compliant, and supports Unicode 2.0, UTF-8, and UTF-16.

QuickTest Professional supports working with the following Mercury applications:

Mercury Application
Versions
WinRunner
QuickTest Professional supports running WinRunner tests and functions for WinRunner 7.6 and later.
Quality Center
QuickTest Professional integrates with Quality Center (formerly TestDirector), the Mercury centralized quality solution, for Quality Center version 8.2—Service Pack 1, and Quality Center version 9.0.
Business Process Testing
QuickTest Professional integrates with Quality Center version 9.0 (with a license for Business Process Testing support).
LoadRunner
QuickTest Professional integrates with LoadRunner, the Mercury tool for application performance testing, for versions 7.8, 7.81 (FP1), 8.0, and 8.1—Feature Pack 1, 2, and 3.
Mercury Application Management
QuickTest Professional integrates with Mercury Application Management, the Mercury solution for optimizing business availability and problem resolution.

System Requirements

To successfully install and run QuickTest Professional, you need to meet the following system requirements:

Computer/Processor:
IBM-PC or compatible with a Pentium III or higher (Pentium IV or higher recommended) microprocessor.
Operating System:
Windows 2000—Service Pack 4, Update Rollup 1 for Windows 2000 Service Pack 4, Windows XP 32-Bit Edition—Service Pack 2, Windows XP 64-Bit Edition—Service Pack 1, Windows Server 2003 32-Bit Edition—Service Pack 1, Windows Server 2003 R2 (32-Bit x86), Windows 2003 64-Bit Edition, or Windows Vista 32-bit Edition.
Memory:
Minimum of 512 MB.
Color Settings:
Minimum of High Color (16 bit).
Graphics Card:
Graphics card with 4 MB video memory (8 MB and above recommended)
Free Hard Disk Space:
480 MB of free disk space for application files and folders (recommended 630 MB), and an additional 120 MB of free disk space on the system disk (the disk on which the operating system is installed).
The free disk space requirements do not include disk space required for any prerequisites that may need to be installed before installing QuickTest.
After QuickTest Professional is installed, it is recommended to have at least 150 MB free disk space on the system disk for the operating system and QuickTest Professional to run correctly.
Browser:
Microsoft Internet Explorer 6.0 Service Pack 1 or Microsoft Internet Explorer 7.0.

Supported Add-ins

The following specific add-in versions are supported with QuickTest Professional 9.2:

  • QuickTest Professional Java Add-in 9.1
  • QuickTest Professional .NET Add-in 9.2
  • QuickTest Professional Oracle Add-in 8.2
  • QuickTest Professional PeopleSoft Add-in 8.2*
  • QuickTest Professional Add-in 8.2 for SAP Solutions
  • QuickTest Professional Siebel Add-in 8.0*
  • QuickTest Professional Stingray Add-in 8.2
  • QuickTest Professional Terminal Emulator Add-in 8.0*
  • QuickTest Professional VisualAge Smalltalk Add-in 8.2
  • QuickTest Professional Web Services Add-in 9.2

Supported Environments and Programs

QuickTest Professional supports creating, recording, and running tests or components using the environments and programs described below.

Virtualization Technologies

  • VMware workstation 5.5
  • Citrix MetaFrame Presentation Server 4.0

Standard Windows Applications

QuickTest Professional supports testing on applications based on Win32 API and MFC. QuickTest Professional does not support testing on 64-bit applications.

Visual Basic Applications

QuickTest Professional supports testing on Visual Basic 6.0 applications.

Note: Visual Basic .NET applications are supported by the QuickTest Professional .NET Add-in.

Browsers

  • Microsoft Internet Explorer 6.0 Service Pack 1
  • Microsoft Internet Explorer 7.0
  • Netscape Browser 8.1.2
  • Mozilla Firefox 1.5
  • Mozilla Firefox 2.0

ActiveX Grid Controls

In addition to basic support of ActiveX properties and methods, QuickTest Professional supports context-sensitive recording and verification on the following ActiveX Grid controls:

Name
ProgId
FarPoint Spreadsheet 2.5
FPSpread.Spread.1
FarPoint Spreadsheet 3.0
FPSpread.Spread.2
FarPoint Spreadsheet 3.5
FPSpread.Spread.3
FarPoint Spreadsheet 6.0
FPSpread.Spread.4
FarPoint Spreadsheet 3.0 (OLEDB)
FPSpreadADO.fpSpread.2
FarPoint Spreadsheet 3.5 (OLEDB)
FPSpreadADO.fpSpread.3
FarPoint Spreadsheet 6 (OLEDB)
FPSpreadADO.fpSpread.4
FarPoint Spread 7.0 (OLEDB)
FPSpreadADO.fpSpread.5
FarPoint Spread 7.0 (OLEDB) (UNICODE)
FPUSpreadADO.fpSpread.5
Microsoft Grid 1.0
MSGrid.Grid
Microsoft DataBound Grid 5.0
MSDBGrid.DBGrid
Microsoft Flex Grid 6.0
MSFlexGridLib.MSFlexGrid.1
Sheridan Data Grid 2.0
SSDataWidgets.SSDBGridCtrlApt.1
Sheridan Data Grid 3.1
SSDataWidgets.SSDBGridCtrlApt.3
Apex True DataBound Grid 5.0
TrueDBGrid50.TDBGrid
Apex True DataBound Grid 6.0
TrueDBGrid60.TDBGrid
Apex True OLE DB Grid 6.0
TrueOleDBGrid60.TDBGrid

ActiveX Calendar Controls

In addition to built-in support for ActiveX properties and methods, QuickTest Professional supports context-sensitive recording and verification on the following ActiveX Calendar controls:

Name
ProgId
Microsoft Date and Time Picker Control 6.0 (SP4)
MSComCtl2.DTPicker.2
Microsoft MonthView Control 6.0 (SP4)
MSComCtl2.MonthView.2

Microsoft Excel

When using Microsoft Excel files with QuickTest Professional (for example, to import or export data to or from the Data Table), you can work with Microsoft Excel 2000, 2002, 2003, and XP.

Microsoft Query

When using Microsoft Query with QuickTest Professional (for example, for Database checkpoints), you can work with Microsoft Query 2000, 2002, 2003, and XP.

Additional Environments

QuickTest Professional add-ins support other environments such as Java, .NET Windows and Web Forms, Windows Presentation Foundation, SAP Solutions, Oracle, Siebel, PeopleSoft, VisualAge Smalltalk, Stingray, Web Services, and terminal emulator applications. For more information on QuickTest Professional add-ins, refer to the relevant add-in documentation. 


QuickTest Professional Tutorial : Click Here!!