Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
process of macro recording encountered some problems
#1
Hello, in the process of macro recording encountered some problems, hope to get your help! I tried to record the window、control、 send key, are not successful, I recorded the process of operation into a video, easy to check! Thanks a lot!
Download LinksSadBecause the link can not be made, so the address can only be written in the picture)
The code in the video:

Macro Macro1
Trigger SF9     Help - how to add the trigger to the macro
Code:
Copy      Help
run "$desktop$\iMindQ_8_1_1_51836.exe"
int w=wait(30 WA win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))

;#region Recorded 12/26/2016 4:56:24 AM
;int w1=act(win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))
;lef 35 8 id(2851 w1) 1 ;;push button 'Next >'
;int w2=wait(16 win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))
;lef 9 9 id(2689 w2) 1 ;;radio button 'I accept the terms in the l...'
;lef 39 5 id(2851 w2) 1 ;;push button 'Next >'
;int w3=wait(19 win("iMindQ® - InstallShield Wizard" "MsiDialogNoCloseClass"))
;lef 13 5 id(4172 w3) 1 ;;check box 'FreeMind (.mm) files'
;lef 12 8 id(4175 w3) 1 ;;check box 'MindJet MindManager (.mmap)...'
;lef 47 14 id(2851 w3) 1 ;;push button 'Next >'
;int w4=wait(19 win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))
;lef 47 12 id(2922 w4) 1 ;;push button 'Install'
;int w5=wait(108 win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))
;lef 35 9 id(2890 w5) 1 ;;push button 'Finish'
;#endregion

#region Recorded 12/26/2016 5:00:22 AM
int w1=act(win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))
lef 340 337 w1 1 ;;push button 'Next >'
int w2=wait(15 win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))

'Aa             ;; Alt+A
'An             ;; Alt+N

;lef 19 256 w2 1 ;;radio button 'I accept the terms in the l...'
;lef 351 333 w2 1 ;;push button 'Next >'
int w3=wait(20 win("iMindQ® - InstallShield Wizard" "MsiDialogNoCloseClass"))
lef 70 254 w3 1 ;;check box 'FreeMind (.mm) files'
lef 68 276 w3 1 ;;check box 'MindJet MindManager (.mmap)...'
lef 343 328 w3 1 ;;push button 'Next >'
int w4=wait(20 win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))
lef 341 331 w4 1 ;;push button 'Install'
int w5=wait(97 win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))
lef 356 334 w5 1 ;;push button 'Finish'
#endregion


Attached Files Image(s)
   
#2
I think the problem is that all the installer windows have the same name. Then next win(...) or wait(win(...)) finds old window.

Try to insert simple wait commands before win(...) and wait(win(...)). Or maybe better wait until previous window disappears.
Macro Macro2739
Code:
Copy      Help
run "$desktop$\iMindQ_8_1_1_51836.exe"
int w=wait(30 WA win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))

#region Recorded 12/26/2016 4:56:24 AM
wait 0 -WV w
int w1=act(win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))
lef 35 8 id(2851 w1) 1 ;;push button 'Next >'
wait 0 -WV w1
int w2=wait(16 win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))
lef 9 9 id(2689 w2) 1 ;;radio button 'I accept the terms in the l...'
lef 39 5 id(2851 w2) 1 ;;push button 'Next >'
wait 0 -WV w2
int w3=wait(19 win("iMindQ® - InstallShield Wizard" "MsiDialogNoCloseClass"))
lef 13 5 id(4172 w3) 1 ;;check box 'FreeMind (.mm) files'
lef 12 8 id(4175 w3) 1 ;;check box 'MindJet MindManager (.mmap)...'
lef 47 14 id(2851 w3) 1 ;;push button 'Next >'
wait 0 -WV w3
int w4=wait(19 win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))
lef 47 12 id(2922 w4) 1 ;;push button 'Install'
wait 0 -WV w4
int w5=wait(108 win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))
lef 35 9 id(2890 w5) 1 ;;push button 'Finish'
#endregion

Code:
Copy      Help
https://www.dropbox.com/sh/8zt4lvct33aac9b/AAA0rmrf4ZDB30nu5Saq69DWa?dl=0
#3
Use your code still can not run in sequence, feeling a bit strange, do not know where the problem, trouble you once again to help, thanks!

I have tried a lot of installation procedures, have the same problem, if QM can intelligently identify the problem, it would be great, I hope that the future version can be achieved!
#4
Try to insert this at the beginning:

deb 2000

Then the macro will wait 2 seconds before executing each line, and in the code editor you'll see a yellow arrow at that line. It can help you to find where is the problem, which code runs too fast, where need to wait.
#5
Hello, stay in the following places, feel a little strange, why not continue?


Attached Files Image(s)
   
#6
Where does not continue, it means that it is the same window. Remove that wait 0 -WV line.
#7
I tested an older installed version, failed to download the newest, therefore the below macro probably will not work with your version (and it is not complete), it is just an example that works on my computer. Note that button ids changed, therefore better to record without the "Control" option.

Macro Macro2739
Code:
Copy      Help
;deb 2000
run "Q:\Downloads\iMindQ_15day_7_0_1_51051_Sites.exe"
int w=wait(30 WA win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))

#region Recorded 2016-12-27 08:46:46
;int w1=act(win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass")) ;;;;;;;;the same as above
lef 351 333 w 1 ;;push button 'Next >'
wait 0 -WV w
int w2=wait(15 win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))
lef 36 263 w2 1 ;;radio button 'I accept the terms in the l...'
lef 349 334 w2 1 ;;push button 'Next >'
wait 0 -WV w2

;it seems that your installer does not have this page, therefore your macro would not have these 4 lines
int w3=wait(24 win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))
lef 34 254 w3 1 ;;check box 'I would like to receive inf...'
lef 349 336 w3 1 ;;push button 'Next >'
wait 0 -WV w3

int w4=wait(21 win("iMindQ® - InstallShield Wizard" "MsiDialogNoCloseClass"))
lef 72 258 w4 1 ;;check box 'FreeMind (.mm) files'
lef 70 280 w4 1 ;;check box 'MindJet MindManager (.mmap)...'
lef 344 335 w4 1 ;;push button 'Next >'
#endregion
#8
Hello, now entered into the final step, stopped, and did not click the Finish button to change the times did not take effect, I would like to ask which command can be the perfect solution? Thanks again!


Attached Files Image(s)
   
#9
My macro is incomplete, it does not click the Finish button, but stops there. Record whole macro like before, with selected "Window" or "Control". Then insert wait 0 -WV lines like in my macro.
#10
After several tests, and finally succeeded, adding two lines of code, see the following picture, the entire macro code, if not (wait 0 -WV w *) is not working, and in each waiting window below, add Activation of the code, for example (act (win ("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))), if not, may not find the window!

If QM can automatically add the act code after each wait window! After the end of the current window: automatically add (wait 0 -WV w *) code, it will be more successful! More intelligent!

Finally, thanks to Mr. Gintaras for his great support and help!

After the success of the code is as follows:

Macro Macro1
Trigger SF9     Help - how to add the trigger to the macro
Code:
Copy      Help
run "$desktop$\iMindQ_8_1_1_51836.exe"
int w=wait(30 WA win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))

#region Recorded 12/26/2016 4:56:24 AM
int w1=act(win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))
lef 35 8 id(2851 w1) 1 ;;push button 'Next >'
wait 0 -WV w1
int w2=wait(16 win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))
lef 9 9 id(2689 w2) 1 ;;radio button 'I accept the terms in the l...'
lef 39 5 id(2851 w2) 1 ;;push button 'Next >'
wait 0 -WV w2
int w3=wait(19 win("iMindQ® - InstallShield Wizard" "MsiDialogNoCloseClass"))
lef 13 5 id(4172 w3) 1 ;;check box 'FreeMind (.mm) files'
lef 12 8 id(4175 w3) 1 ;;check box 'MindJet MindManager (.mmap)...'
lef 47 14 id(2851 w3) 1 ;;push button 'Next >'
wait 0 -WV w3
int w4=wait(19 win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))
lef 47 12 id(2922 w4) 1 ;;push button 'Install'
wait 0 -WV w4
int w5=wait(30 WA win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))
wait 0 -WV w5
int w6=win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass")
lef 41 11 id(2890 w6) 1 ;;push button 'Finish'

#endregion


Attached Files Image(s)
   
#11
I found the same problem during many of the installer recordings, so it is recommended:

1. If multiple windows are recorded with the same title, add the code before proceeding to the next window: (wait 0 -WV w *) This saves debugging time

2. After the wait window code is automatically added: Activate the window code, which will increase the success rate
#12
Yes, this or similar will be in the future. Also in the future QM should record "wait for window containing control X", which is now supported by win().
#13
Thank you very much, wish QM software more and more intelligent! Come on.
#14
Hello, feedback, I derived from QM exe file, in actual use, often appear in the first window or the last window to stop the case, do not know why, but in the QM debugging is OK
#15
Into a number of attempts to generate exe before, set up the following image options, the situation seems much better, must set this option?


Attached Files Image(s)
   
#16
The "Run in separate process" option does not change .exe properties. But it can be useful when developing a macro for .exe: if checked, the Run button creates and runs .exe file (or .qmm file, as set in dialog "Make Exe").
#17
kyjdp Wrote:Hello, feedback, I derived from QM exe file, in actual use, often appear in the first window or the last window to stop the case, do not know why, but in the QM debugging is OK

Try to insert this at the beginning:

spe 1000

Then waits 1000 ms after each lef. By default waits 100 ms in macro, 0 ms in function.

Also insert this after each line containing wait...win:

1

It waits 1 second.

Also replace 30 to 60.
#18
Thank you for your reminder, I will try later, you reply to the message has reached 10,000, very much admire your enthusiasm! Smile Smile


Attached Files Image(s)
   
#19
Feedback, I put the code has been changed:

Int w * = wait (16 win ("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))

Change to:

Int w * = wait (0 WA win ("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))

In all the computers can be run perfectly!

So I recommend that QM developers use the code preferentially when recording a form: int w * = wait (0 WA win This will make the final success, in addition, at the end of each form, use the code: wait 0 - WV w *

The final code is as follows:

Macro install
Code:
Copy      Help
#region Recorded 2016-12-28 20:14:44
run "$qm$\iMindQ_8_1_1_51836.exe"

int w2=wait(0 WA win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))
lef 43 11 id(2851 w2) 1 ;;push button 'Next >'
wait 0 -WV w2

int w3=wait(0 WA win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))
lef 21 10 id(2689 w3) 1 ;;radio button 'I accept the terms in the l...'
lef 45 10 id(2851 w3) 1 ;;push button 'Next >'
wait 0 -WV w3

int w4=wait(0 WA win("iMindQ® - InstallShield Wizard" "MsiDialogNoCloseClass"))
lef 39 11 id(4172 w4) 1 ;;check box 'FreeMind (.mm) files'
lef 38 9 id(4175 w4) 1 ;;check box 'MindJet MindManager (.mmap)...'
lef 41 14 id(2851 w4) 1 ;;push button 'Next >'
wait 0 -WV w4

int w5=wait(0 WA win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))
lef 41 14 id(2922 w5) 1 ;;push button 'Install'
wait 0 -WV w5

int w6=wait(0 WA win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))
wait 0 -WV w6

int w7=wait(0 WA win("iMindQ® - InstallShield Wizard" "MsiDialogCloseClass"))
lef 41 14 id(2890 w7) 1 ;;push button 'Finish'
#endregion


Forum Jump:


Users browsing this thread: 1 Guest(s)