Check for possible error box

Creating macros. Working with QM.

Check for possible error box

Postby almulder on Thu Oct 12, 2017 8:37 am

I am trying to automate the install of an application and it works, however there is one part that might fail if part of the software is already installed.

How can I check for that?

Current Code (Works great)

int w4=wait(21 win("End User License Agreement" "*.Window.*"))
lef 271 12 w4 ;;title bar
lef 435 574 w4 1 ;; 'End User License Agreement'
lef 637 586 w4 1 ;;push button 'I Accept'
int w5=wait(48 win("Redistributable Installation Complete!" "*.Window.*"))
lef 518 182 w5 1 ;;push button 'OK'



But need to Check if this happens before last window. (if it does I want to click ok and then wait for last window)

int w5=wait(111 win("Installation Failed" "*.Window.*"))
lef 480 167 w5 1 ;;push button 'OK'



Is there a default time out if the last ok box does not appear? sometimes if part of it fails the ok box might not appear, and other times it does.
almulder
 
Posts: 2
Joined: Thu Oct 12, 2017 8:24 am

Re: Check for possible error box

Postby Gintaras on Thu Oct 12, 2017 9:41 am

try

int w4=wait(21 win("End User License Agreement" "*.Window.*"))
lef 271 12 w4 ;;title bar
lef 435 574 w4 1 ;; 'End User License Agreement'
lef 637 586 w4 1 ;;push button 'I Accept'
int th=mac("sub.CloseFailedWindow")
int w5=wait(48 win("Redistributable Installation Complete!" "*.Window.*"))
EndThread "" th
lef 518 182 w5 1 ;;push button 'OK'


#sub CloseFailedWindow
int w5=wait(111 win("Installation Failed" "*.Window.*"))
lef 480 167 w5 1 ;;push button 'OK'

Gintaras
Site Admin
 
Posts: 10412
Joined: Thu Dec 19, 2002 7:36 pm
Location: Lithuania

Re: Check for possible error box

Postby almulder on Thu Oct 12, 2017 4:16 pm

that worked perficly.

Maybe you can help me with another one. Same issue

This one is a little different.

when it runs and not installed. it goes great

int w1=act(win("Microsoft Xbox 360 Accessories Setup" "#32770"))
lef 33 256 w1 1 ;;graphic
lef 373 336 w1 1 ;;push button 'Next >'
lef 373 336 w1 1 ;;push button 'Finish'



but if installed it gives an error.


int w1=act(win("Microsoft Xbox 360 Accessories" "#32770"))
lef 426 136 w1 1 ;;push button 'OK'




So I came up with this code, but does not work. (Note: The error will be the first window if there is an error)

#region Recorded 10/12/2017 8:56:40 AM
int th=mac("sub.CloseFailedWindow")
int w1=act(win("Microsoft Xbox 360 Accessories Setup" "#32770"))
lef 33 256 w1 1 ;;graphic
lef 373 336 w1 1 ;;push button 'Next >'
lef 373 336 w1 1 ;;push button 'Finish'
EndThread "" th
#endregion

#sub CloseFailedWindow
int w1=act(win("Microsoft Xbox 360 Accessories" "#32770"))
lef 426 136 w1 1 ;;push button 'OK'
#endregion

almulder
 
Posts: 2
Joined: Thu Oct 12, 2017 8:24 am

Re: Check for possible error box

Postby Gintaras on Thu Oct 12, 2017 4:43 pm

Probably does not work because by default win finds windows that match partial name. Use flag 1. If don't know how to set it, click button "Edit..." in dialog "Mouse" or other dialog where it is.
Gintaras
Site Admin
 
Posts: 10412
Joined: Thu Dec 19, 2002 7:36 pm
Location: Lithuania


Return to General

Who is online

Users browsing this forum: No registered users and 3 guests