How to Press Ok button on webpage

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Sep 14, 2006 9:06 am

Ok, I see the problem. For some reason the ClickTag function cannot return while the dialog is present. I've not seen that before. There should be no reason why the code has not returned at this point. However, all this button does is perform a validation routine and then submit the form. We don't need the validation routine, we just want to submit the form. We can therefore bypass this button by submitting the form direct. We can do this by setting the event flag of the final FormFill function to submit.

So remove the ClickTag line and make your finaly FormFill call look like this:

LibFunc>hIE,FormFill,r,%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,submit

E.g.:

Let>FrameName={""}
Let>FormName={"manactv"}
Let>FieldName={"cmbCommandId"}
Let>FieldValue={"Display Tel. Status"}
LibFunc>hIE,FormFill,r,%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,submit

And then remove the pbActv / ClickTag lines altogether. They are not needed. This bypasses the alert dialog completely.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

mfauzim
Pro Scripter
Posts: 89
Joined: Wed Sep 13, 2006 10:57 am

Another issue

Post by mfauzim » Thu Sep 14, 2006 9:40 am

I already did as your suggestion, but it did not submit the form: below is the fix code:


Let>FrameName={""}
Let>FormName={"manactv"}
Let>FieldName={"cmbCommandId"}
Let>FieldValue={"Display Tel. Status"}
LibFunc>hIE,FormFill,r,%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,submit

//LibFunc>hIE,FormFill,r,%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0

//Let>FrameName={""}
//Let>FormName={"manactv"}
//Let>TagValue={"pbActv"}
//LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,INPUT,NAME,str:TagValue
//pushbutton>Microsoft Internet Explorer,OK
//
//Press Enter
//WaitWindowOpen>Microsoft Internet Explorer*
//SetFocus>Microsoft Internet Explorer*
//Press Enter

WaitWindowOpen>ITS Message - Microsoft Internet Explorer
//WaitWindowOpen>Manual Switch Activation - Microsoft Internet Explorer

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Sep 14, 2006 9:49 am

Try it with a different field - swap the field order. E.g. it works with the telephone number field. Make this your last field entry:

Let>FrameName={""}
Let>FormName={"manactv"}
Let>FieldName={"txtTelNo"}
Let>FieldValue={"00356370496"}
LibFunc>hIE,FormFill,r,%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,submit
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

mfauzim
Pro Scripter
Posts: 89
Joined: Wed Sep 13, 2006 10:57 am

Cannot Swap the field

Post by mfauzim » Thu Sep 14, 2006 10:05 am

We cannot swp the entry sequence because of the following:
1. enter telno then click refresh button, The refresh button will populate action allowed in the drop down button. If we do not refresh button, then there will be no pull down action population

2select action . Display Tel. Status
3. click activate then dialog box apprear. click ok to submit.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Sep 14, 2006 10:38 am

So just DUPLICATE the telno field at the end. You won't need to click refresh:

FormFill>telephone number
Refresh
FormFill>next field
FormFill>next field
FormFill>drop down
FormFill>telephone number,...,submit

Doesn't matter. The value won't change. It just allows us to submit the form without clicking the button.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

mfauzim
Pro Scripter
Posts: 89
Joined: Wed Sep 13, 2006 10:57 am

Still Cannot Work- form did not submit

Post by mfauzim » Thu Sep 14, 2006 10:48 am

I'v tried as your suggestion: see code below, but still form do not submit.



Let>FrameName={""}
Let>FormName={"manactv"}
Let>TagValue={"pbRefresh"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,INPUT,NAME,str:TagValue

LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay

Let>FrameName={""}
Let>FormName={"manactv"}
Let>FieldName={"cmbCommandId"}
Let>FieldValue={"Display Tel. Status"}
LibFunc>hIE,FormFill,r,%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0


Let>FrameName={""}
Let>FormName={"manactv"}
Let>FieldName={"txtTelNo"}
Let>FieldValue=%TelRtn%

LibFunc>hIE,FormFill,r,%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,submit

WaitWindowOpen>ITS Message - Microsoft Internet Explorer
//WaitWindowOpen>Manual Switch Activation - Microsoft Internet Explorer
//SetFocus>Microsoft Internet Explorer
//Press Enter
wait>1

mfauzim
Pro Scripter
Posts: 89
Joined: Wed Sep 13, 2006 10:57 am

More info

Post by mfauzim » Thu Sep 14, 2006 10:51 am

When execute the last submit, the form do not submit, but it return to state when it start to press 'refresh' button with telno inside the text field.

regards

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Sep 14, 2006 11:05 am

Crumbs - it worked for me!

Ok, here's another solution, after your last FormFill add this code:

SetFocus>Manual Switch Activation - Microsoft Internet Explorer
Press Tab * 7
Wait>0.3
Press Enter

That will focus the button and press Enter on it. Thus clicking it.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

mfauzim
Pro Scripter
Posts: 89
Joined: Wed Sep 13, 2006 10:57 am

Still Not working

Post by mfauzim » Fri Sep 15, 2006 8:50 am

Dear Marcus, i have tried all your suggestion and even goes back to my iroginal scripte. rebooot computer, but still it cannot work. Pls help, I need to demo to customer next week/tuesday..Really appreciate your help all the while

below is my lates code and with all the remarks/comments. pls feel free to indicate precisely where/what else i should try.



// step 1 refresh button. and display valid action
Let>FrameName={""}
Let>FormName={"manactv"}
Let>TagValue={"pbRefresh"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,INPUT,NAME,str:TagValue

LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay

// step 2 . select action required
Let>FrameName={""}
Let>FormName={"manactv"}
Let>FieldName={"cmbCommandId"}
Let>FieldValue={"Display Tel. Status"}
LibFunc>hIE,FormFill,r,%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0
wait>2


Let>FrameName={""}
Let>FormName={"manactv"}
Let>TagValue={"pbActv"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,INPUT,NAME,str:TagValue
//pushbutton>Microsoft Internet Explorer,OK
wait>2
Press Enter

//SetFocus>Manual Switch Activation - Microsoft Internet Explorer
//Press Tab * 7
//Press Tab
wait>2
//Press Tab
//Press Tab
//Press Tab
//Press Tab
//Press Tab
//Press Tab
//Wait>2
//Press Enter
//wait>2
//Press Enter

// Let>FrameName={""}
// Let>FormName={"manactv"}
// Let>FieldName={"txtTelNo"}
// Let>FieldValue=%TelRtn%

// LibFunc>hIE,FormFill,r,%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,submit




WaitWindowOpen>ITS Message - Microsoft Internet Explorer
//WaitWindowOpen>Manual Switch Activation - Microsoft Internet Explorer
//SetFocus>Microsoft Internet Explorer
//Press Enter
wait>1

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Sep 15, 2006 8:59 am

This works for me:

Code: Select all

// step 1 refresh button. and display valid action
Let>FrameName={""}
Let>FormName={"manactv"}
Let>TagValue={"pbRefresh"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,INPUT,NAME,str:TagValue

LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay

// step 2 . select action required
Let>FrameName={""}
Let>FormName={"manactv"}
Let>FieldName={"cmbCommandId"}
Let>FieldValue={"Display Tel. Status"}
LibFunc>hIE,FormFill,r,%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0
wait>2

SetFocus>Manual Switch Activation - Microsoft Internet Explorer
Press Tab * 7
Wait>0.2
Press Enter
No problems.

But I'm working on a static copy of your html page, and I suppose there could be something different about your system. I would be happy to set up a desktop sharing session and get this working for you. See http://www.mjtnet.com/support.htm for details and to contact us.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

mfauzim
Pro Scripter
Posts: 89
Joined: Wed Sep 13, 2006 10:57 am

Still Not working

Post by mfauzim » Fri Sep 15, 2006 9:10 am

I've copied your code, but somehow it still not working on my machine. As for remote desktop, I already reequested for it.

regards

mfauzim
Pro Scripter
Posts: 89
Joined: Wed Sep 13, 2006 10:57 am

Thank for the Real Support

Post by mfauzim » Fri Sep 15, 2006 10:24 am

Marcus, thanks for rsolving my problem thru the remote control.
I would like to register my appreciation for all the support and this is what I call a real first class support.


regards

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Sep 15, 2006 7:28 pm

Those of us who have been following this are curious about the final soluton.
Cause/Solution?

Remote assistance indeed. Where else does that get offered?

Great support Marcus.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Sep 15, 2006 7:56 pm

The number of Press Tabs needed to be different on mfauzim's system. We actually ended up using Shift-Tab to go backwards to avoid issues with the target system having a different number of toolbars etc. I also suggested Image Recognition as another solution.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

mfauzim
Pro Scripter
Posts: 89
Joined: Wed Sep 13, 2006 10:57 am

share the code

Post by mfauzim » Mon Sep 18, 2006 8:51 am

attache is the code for anyone to review;


SRT>ACT_TelRtn
//label>ACT_TelRtn
Let>FrameName={""}
Let>FormName={"manactv"}
Let>FieldName={"txtTelNo"}
Let>FieldValue=%TelRtn%

LibFunc>hIE,FormFill,r,%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0

// step 1 refresh button. and display valid action
Let>FrameName={""}
Let>FormName={"manactv"}
Let>TagValue={"pbRefresh"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,INPUT,NAME,str:TagValue

LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay

// step 2 . select action required
Let>FrameName={""}
Let>FormName={"manactv"}
Let>FieldName={"cmbCommandId"}
Let>FieldValue={"Display Tel. Status"}
LibFunc>hIE,FormFill,r,%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0
wait>2

SetFocus>Manual Switch Activation - Microsoft Internet Explorer
Press Shift
Press Tab * 5
Release Shift
Wait>0.2
Press Enter
Wait>2
SetFocus>Microsoft Internet Explorer
Press Enter

LibFunc>hIE,WaitIE,r,%IE[0]%

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts