Search This Blog

Sunday, December 9, 2012

Run QTP when the monitor is off/minimized


Change the following registry settings:-
Step 1: Goto HKEY_LOCAL_MACHINE\SOFTWARE\Mercury Interactive\QuickTest Professional\MicTest
Step 2: Locate the key “SkipEnvironmentChecks”
step 3: Change the value to “1″ (Default value is 0)
Step 4: Restart the QTP.

Thursday, November 15, 2012

Automating a checkbox in a combo box



val = Dialog(DialogName).WinComboBox(ComboBoxName).GetVisibleText
Num = Dialog(DialogName).WinComboBox(ComboBoxName).GetItemsCount

For i = 0 to Num-1
          selectitem = Dialog(DialogName).WinComboBox(ComboBoxName).GetItem(i)
          Pos = Instr(1, val,selectitem)
          If Pos <> 0 Then
                   On Error Resume Next
                   Dialog(DialogName).WinComboBox(ComboBoxName).Select i
          End If
          val = Dialog(DialogName).WinComboBox(ComboBoxName).GetVisibleText
Next


checkval = "Local"

For i = 1 to 2
          selectitem = Dialog(DialogName).WinComboBox(ComboBoxName).GetItem(i)
          Pos = Instr(1, checkval,selectitem)
          If Pos <> 0 Then
                   On Error Resume Next
                   Dialog(DialogName).WinComboBox(ComboBoxName).Select i
          End If
Next