Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check for possible error box
#1
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)
Code:
Copy      Help
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)
Code:
Copy      Help
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.
#2
try

Code:
Copy      Help
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'
#3
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
Code:
Copy      Help
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.

Code:
Copy      Help
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)
Code:
Copy      Help
#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
#4
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.


Forum Jump:


Users browsing this thread: 1 Guest(s)