Posts: 166
Threads: 57
Joined: Aug 2013
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 )
e12.SetText ( place)
mes - "Go Ahead?" "Go Ahead?" "OC"
;Click Register Sale
Htm e13= htm ( "INPUT" "ctl00_cphMain_btnRegister" "" w "0" 50 0x121 3 )
e13.Click
;Click 'OK' on email error message
int w3= wait ( 31 win ( "Message from webpage" "#32770" ))
Best Regards,
Philip
Posts: 97
Threads: 25
Joined: Jan 2013
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 )
e.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,090
Threads: 142
Joined: Dec 2002
Try to replace
e13.Click
to
e13.ClickAsync
Posts: 166
Threads: 57
Joined: Aug 2013
Tried that now.
Aim does not produce a result.
Rather I tried the below too (via Windows action) and I get the window handle.
Don't know how to go from here.
How do I click the ok button?
int w3=win("Message from webpage" "#32770")
act id(1 w3) ;;push button 'OK'
Best Regards,
Philip
Posts: 12,090
Threads: 142
Joined: Dec 2002
Posts: 166
Threads: 57
Joined: Aug 2013
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,
Philip
Posts: 12,090
Threads: 142
Joined: Dec 2002
What exactly fails?
The wait line waits 10 s then error?
The Acc line waits 10 s then error?
Error at a.Mouse?
a.Mouse is executed but nothing happens?
...
Posts: 166
Threads: 57
Joined: Aug 2013
Just waits indefinitely when the message box appears
Whereas, when I test using the dialog box, it works...
Best Regards,
Philip
Posts: 12,090
Threads: 142
Joined: Dec 2002
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
Threads: 57
Joined: Aug 2013
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,
Philip
Posts: 12,090
Threads: 142
Joined: Dec 2002
e13.Click waits, replace to e13.ClickAsync
Posts: 166
Threads: 57
Joined: Aug 2013
Perfecto...works like a breeze.
So, it's the click code prior to the issue code that needed the amending.
Thanks Gintaras.
Best Regards,
Philip