How to Press Ok button on webpage
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
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.
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?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Another issue
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
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
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
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
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?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Cannot Swap the field
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.
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.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
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.
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?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Still Cannot Work- form did not submit
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
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
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
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.
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?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Still Not working
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
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
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
This works for me:
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.
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
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?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Still Not working
I've copied your code, but somehow it still not working on my machine. As for remote desktop, I already reequested for it.
regards
regards
Thank for the Real Support
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
I would like to register my appreciation for all the support and this is what I call a real first class support.
regards
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
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?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
share the code
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]%
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]%