Posts: 166
 
	
	
		Greetings Friends,
I need to have the 'ok' button clicked for an error message that pops up from a website.
Kindly advise.
Macro 
temp  ;City Htm  e12= htm ( "INPUT"  "ctl00_cphMain_txtCity"  ""  w "0"  39  0x121  3 ) SetText ( place) mes -  "Go Ahead?"  "Go Ahead?"  "OC" ;Click Register Sale Htm  e13= htm ( "INPUT"  "ctl00_cphMain_btnRegister"  ""  w "0"  50  0x121  3 ) Click ;Click 'OK' on email error message int  w3= wait ( 31  win ( "Message from webpage"  "#32770" )) 
Best Regards,
	
	
 
 
	
	
	
		
	Posts: 97
 
	
	
		On the QuickMacros top toolbar choose: Windows, controls > HTML element actions:
Then, follow the wizard, drag the aim to the "OK" button and choose the "Click" action.
The code should look a little like this:
Function 
teste  int  w= wait ( 3  WV win ( "(...)"  "IEFrame" )) Htm  e= htm ( "OK"  " "  ""  w "0"  144  0x21  3 ) Click 
Where: 
int w = is the window variable
Htm e = is the HTML element variable
e.click = is the click action on the HTML element
	
 
 
	
	
	
		
	Posts: 12,239
 
	
	
		Try to replace
	
	
	
	
 
 
	
	
	
		
	Posts: 166
 
	
	
		Tried that now.
	
	
Best Regards,
	
	
 
 
	
	
	
		
	Posts: 12,239
 
 
	
	
	
		
	Posts: 166
 
	
	
		I am still unable to get the child message box to be clicked...
Kindly take a look at the JPEG file.
Code used as below:
Macro 
RO Sales gDN  , ;Click 'OK' on email error message , int  w11= wait ( 10  WV win ( "Message from webpage"  "#32770" )) , Acc  a.Find ( w11 "PUSHBUTTON"  "OK"  "class=Button[]id=1"  0x1035  10 ) , a.Mouse ( 1 ) 
Attached Files Image(s)  
	
Best Regards,
	
	
 
 
	
	
	
		
	Posts: 12,239
 
	
	
		What exactly fails?
	
	
	
	
 
 
	
	
	
		
	Posts: 166
 
	
	
		Just waits indefinitely when the message box appears
	
	
Best Regards,
	
	
 
 
	
	
	
		
	Posts: 12,239
 
	
	
		This code cannot wait more than 20 s. Are you sure it is executed? Maybe waits previous statement. For example if it is like e.Click, it waits until message box closed.
	
	
	
	
	
 
 
	
	
	
		
	Posts: 166
 
	
	
		Nope that's not the case.
Here is part of the entire code before and after the issue code:
Macro 
RO Sales gDN  , MES  m, m.style= "OC" , m.x= 100 , m.y= 500 , m.timeout= 800 , m.default= 'C' , int  t= mes ( "Go Ahead?"  "Go Ahead?"  m) , , ;Click Register Sale , Htm  e13= htm ( "INPUT"  "ctl00_cphMain_btnRegister"  ""  w "0"  50  0x121  10 ) , e13.Click , , ;wait 2 , ;Click 'OK' on email error message , int  w11= wait ( 10  WV win ( "Message from webpage"  "#32770" )) , Acc  a.Find ( w11 "PUSHBUTTON"  "OK"  "class=Button[]id=1"  0x1035  10 ) , a.Mouse ( 1 ) , err + ,, mes  F "After email error message { _error.line}" , 
Best Regards,
	
	
 
 
	
	
	
		
	Posts: 12,239
 
	
	
		e13.Click waits, replace to e13.ClickAsync
	
	
	
	
	
 
 
	
	
	
		
	Posts: 166
 
	
	
		Perfecto...works like a breeze.
	
	
Best Regards,