Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Recording Option: Retry until successful
#1
Hi Gintaras,

I would really like to see an recording option that retries every window command until it is executed successfully instead of creating an error.
At work I use Quick Test Professional and this is really a convinient option. I don't have to insert any wait for window commands or wait until idle. It just retries until successful or for max. 20 secounds(can be changed in options).
And I would really like to see it in QM too.

I know, I can do it manually, but it is alot more work than getting it automatically when recording :/

Or maybe there is already this option and I oversaw it?

Regards
Staati
#2
Can you give some code examples with comments? Eg recorded code, with your corrections that would be not necessary with the retry-on-error feature.

When recording, QM records new windows with wait(), activated windows with act(). Then uses the handle with lef() etc.
Macro Macro1878
Code:
Copy      Help
;---- Recorded 2012.12.06 19:06:48 ----
int w1=wait(5 win("Font" "#32770")) ;;recorded new window
lef 357 120 w1
;...
int w2=act(win("Font" "#32770")) ;;recorded activated window
lef 368 302 w2
;--------------------------------------
Maybe add an option for win() to wait some time if it does not find the window immediately?

Wanted to test QTP, but it is almost 3 GB...
#3
Hmm I don't get the waits as it seems.
Although I check it in the options? Or is it another option?

Macro Macro
Code:
Copy      Help
;---- Recorded 11.12.2012 07:26:10 ----
int w1=act(win("DC-Doc V2 - All Documents - IBM Lotus Notes" "SWT_Window0"))
dou 361 63 child("" "NotesLineView" w1)
lef 71 18 child("Ausgeführte Anwendungen" "MSTaskListWClass" win("" "Shell_TrayWnd"))
int w2=act(win("Der Postillon: Unglaublich - Google Chrome" "Chrome_WidgetWin_1"))
lef 781 471 child("" "Chrome_RenderWidgetHostHWND" w2)
;--------------------------------------


Attached Files Image(s)
   
#4
Records wait() only when the window is created while recording. If the window already exists, records just act().

Now I see. The window already exists while recording, but it's name changes with a delay, because it is a web browser. In Chrome even new child window is created. I'll think what to do in this case. Probably the best would be a retry-until-successful option, like you suggest. Thank you.


Forum Jump:


Users browsing this thread: 1 Guest(s)