Skip to main content

Posts

How to get installed programs from Registry

Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE strComputer = "." strKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" strEntry1a = "DisplayName" strEntry1b = "QuietDisplayName" strEntry2 = "InstallDate" strEntry3 = "VersionMajor" strEntry4 = "VersionMinor" strEntry5 = "EstimatedSize" Set objReg = GetObject("winmgmts//" & strComputer & "/root/defaultStdRegProv")                                        (oR )   Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _     & strComputer & "\root\default:StdRegProv") objReg.EnumKey HKLM, strKey, arrSubkeys Print  "Installed Applications" & VbCrLf For Each strSubkey In arrSubkeys   intRet1 = objReg.GetStringValue(HKLM, strKey & strSubkey, _    strEntry1a, strValue1) ...

How to get installed programs in Control Panel

Set objFSO = CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.CreateTextFile("c:\software.txt", True) strComputer = "." Set objWMIService = GetObject("winmgmts:" _     & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colSoftware = objWMIService.ExecQuery _     ("Select * from Win32_Product") objTextFile.WriteLine "Caption" & vbtab & _     "Description" & vbtab & "Identifying Number" & vbtab & _     "Install Date" & vbtab & "Install Location" & vbtab & _     "Install State" & vbtab & "Name" & vbtab & _     "Package Cache" & vbtab & "SKU Number" & vbtab & "Vendor" & vbtab _         & "Version" For Each objSoftware in colSoftware     objTextFile.WriteLine objSoftware.Caption ...

How to Read or Select Context Menu or Right Click Menu using QTP.

Select The Item in Right Click Menu or Context Menu: Window("sampleWindow").WinMenu("MenuObjType:=1).Select"File;New" Here MenuObjtype can be 1 r 2 r 3 .......n Check wether the Item is Exist or Not: If Window("sampleWindow").WinMenu("MenuObjType:=1).GetItemProperty("1","Exist") Then   Msgbox"Exist" Else  Msgbox"Does Not Exist" End If                                         Or If Window("sampleWindow").WinMenu("MenuObjType:=1).GetItemProperty("File","Exist") Then   Msgbox"Exist" Else  Msgbox"Does Not Exist" End If Get the Items in Context Menu: For i = 1 to 10 Print  Window("sampleWindow").WinMenu("MenuObjType:=" & i).GetItemProperty("1","Label") Then Next

Broad comparison among QTP and Selenum

# Selenium QTP 1 Open source Paid tool 2 Works on all OS Works on Windows 3 Tests only Web applications Tests web and desktop applications 4 Works on almost all browsers Works on IE ,Firefox and Chrome(Partially) 5 Code can be made in any one of languages such as Java, C#, Ruby, Python, pearl, php etc Uses Vb Script 6 No object repository Has got an object repository 7 IDE sometimes does not record some events Recording is a little reliable events 8 Core engine is java script and is very strong Core engine is not java script based