Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Play 25 macros automatically one after the other
#1
Hi, my question is: I want to play 25 macros (or more) automatically one after the other. How can I do that?
In selenium IDE the cammand is: Play entire test suite.
Is there something similar in Quick Macros?
Thank you for your help in advance. Big Grin
#2
Function RunMultipleMacrosWithDialog
Code:
Copy      Help
;/
function $folder [flags] ;;flags: 1 include subfolders

;Shows a dialog that allows to run multiple macros in sequence.

;folder - folder containing macros.
;;;The dialog will display and run macros in the same order as they are in the folder.

;REMARKS
;If this function is called from a macro, in the Properties dialog of that macro must be selected: Macro properties -> If a macro is running -> Run simultaneously.

;EXAMPLE
;RunMultipleMacrosWithDialog "test suite folder"


ARRAY(QMITEMIDLEVEL) a
if(!GetQmItemsInFolder(folder a flags&1=0)) end ERR_FAILED
__Handle evStop=CreateEvent(0 0 0 0)

str dd=
;BEGIN DIALOG
;0 "" 0x90CF0AC8 0x0 0 0 294 174 "QM - run macros"
;3 ListBox 0x54230109 0x200 72 8 216 160 ""
;4 Button 0x54032000 0x0 8 8 56 14 "Run all"
;5 Button 0x54032000 0x0 8 28 56 14 "Run selected"
;6 Button 0x54032000 0x0 8 132 56 14 "Stop"
;2 Button 0x54030000 0x4 8 152 56 14 "Stop && close"
;END DIALOG
;DIALOG EDITOR: "" 0x2040500 "*" "" "" ""

str controls = "3"
str lb3
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc v
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,DT_SetAutoSizeControls hDlg "3s 2mv 6mv"
,
,int i hlb=id(3 hDlg)
,for i 0 a.len
,,LB_Add hlb _s.getmacro(a[i].id 1)
,,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 4 sub.Run hDlg 0
,case 5 sub.Run hDlg 1
,case [6,IDCANCEL] SetEvent(evStop)
ret 1


#sub Run v
function hDlg !selected

int i j n h=id(3 hDlg)
ARRAY(int) asel.create(a.len)
if selected
,n=SendMessage(h LB_GETSELITEMS a.len &asel[0])
else
,n=a.len
,for(i 0 n) asel[i]=i
if(n<1) ret
ResetEvent(evStop)
opt waitmsg 1
for i 0 n
,j=asel[i]
,LB_SelectItem h -1 2
,LB_SelectItem h j 1
,int ht=mac(a[j].id)
,sel wait(0 HM ht evStop)
,,case 2 EndThread 0 ht; ret
LB_SelectItem h -1 2


Forum Jump:


Users browsing this thread: 1 Guest(s)