Closing a web popup window

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
adivarup
Junior Coder
Posts: 36
Joined: Tue Mar 21, 2006 10:04 pm

Closing a web popup window

Post by adivarup » Thu Mar 23, 2006 7:27 pm

my script logs me in to my site and posts. After I post I get a pop up, telling me i posted. How can I get the script to click the okay button to close this pop up and continue on with the rest of the script.

Thanks
________
Chevrolet Nomad
Last edited by adivarup on Wed Feb 02, 2011 12:32 pm, edited 1 time in total.

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Fri Mar 24, 2006 1:55 am

Does the popup have a Window Title? for instance, this forum has a window title of Macro Scheduler & Windows Automation :: Post a reply*

Take the window title and write somthing like,

setfocus>The Pop-up title goes here* (use the asterisk at the end)
wait>.1
rem> **If the window's OK button is already highlighted***
Press ENTER
waitwindowclosed>The Pop-up title goes here*

You could also substitue whatever keystrokes might activate the OK button for Press ENTER.

adivarup
Junior Coder
Posts: 36
Joined: Tue Mar 21, 2006 10:04 pm

Post by adivarup » Fri Mar 24, 2006 2:39 am

Thanks for responding, I've been working on this all day using things i found here but nothing is working..

So, i get a pop-up dialog box.. in the title, it says "Microsoft Internet Explorer" then the dialog says "You have added your post".

So, should I still use what you wrote below?
________
vaporizer manufacturers
Last edited by adivarup on Wed Feb 02, 2011 12:33 pm, edited 1 time in total.

adivarup
Junior Coder
Posts: 36
Joined: Tue Mar 21, 2006 10:04 pm

Post by adivarup » Fri Mar 24, 2006 2:46 am

Ok, i did this.. but it did not close the window

setfocus>Microsoft Internet Explorer*
wait>.1
rem> **If the window's OK button is already highlighted***
Press ENTER
waitwindowclosed>Microsoft Internet Explorer*
________
Toyota Allion history
Last edited by adivarup on Wed Feb 02, 2011 12:33 pm, edited 1 time in total.

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Fri Mar 24, 2006 3:41 am

hmm....if the popup has focus and OK is the only option, you could just use

Press ENTER

and the popup should go away. If the window's name is Microsoft Internet Explorer you should be able to setfocus on it and then press OK. If you have the window open, then you could use View System Windows to see if that button is a windows object which can be manipulated with

Pushbutton>WinowTitle*,ButtonCaption (button caption must be exactly as it is displayed in View System Windows....&OK, or N&ext...whatever it is)...

maybe send me a screen shot of the app.

adivarup
Junior Coder
Posts: 36
Joined: Tue Mar 21, 2006 10:04 pm

Post by adivarup » Fri Mar 24, 2006 5:09 am

Hello,

So, the commands I used in the previous post do not seem to work.

I then used the View System Windows tool, and then used this in my script.

Pushbutton>Microsoft Internet Explorer*,OK


// Generated by MacroScript WebRecorder 1.70
// Recorded on Thursday, March 23, 2006, at 06:31 PM
LibLoad>IEAuto.dll,hIE
If>hIE=0
MessageModal>Could not load IEAuto.dll, make sure it is in the path or edit the LibLoad line.
Goto>end_script
EndIf

//Move the mouse cursor out of harm's way to avoid causing mouseover events to interrupt
MouseMove>0,0
Let>delay=1

LibFunc>hIE,CreateIE,IE[0],0

LibFunc>hIE,Navigate,r,%IE[0]%,http://www.mydomain.com/test.htm
LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay

Let>FrameName={""}
Let>FormName={""}
Let>TagValue={"Click Here"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,A,TEXT,str:TagValue

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

Pushbutton>Microsoft Internet Explorer*,OK

LibFree>hIE
Label>end_script
________
iolite vaporizer
Last edited by adivarup on Wed Feb 02, 2011 12:33 pm, edited 1 time in total.

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

Post by Marcus Tettmar » Fri Mar 24, 2006 4:18 pm

What do you mean by "popup". Is it another IE window containing a small web page? Or is it a Javascript dialog box?

If the former you can just record it with WebRecorder as it is just another instance of IE browser. If the latter you can send keystrokes to it.

Can you send a screen shot to show us what you are seeing? Even better, can we access the same URL and run the same script? If so we could fix it for you. Or failing all of that email support and we can hook up to your screen and check it out.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

adivarup
Junior Coder
Posts: 36
Joined: Tue Mar 21, 2006 10:04 pm

Post by adivarup » Fri Mar 24, 2006 5:41 pm

Hi, thanks for your support!

I have two test files that I created... File one is called test.htm and file two is called test2.htm

Test 1 is a blank page with a hyperlink to test2. Test two has javascript on it..

Here are the pages. I do not know how to show you what I am looking at. I can PM you the URL. Here it is the code

Test.htm

Click Here



Here is the code on test2.htm

-->
alert("This is a test popup message")

________
Colony Park
Last edited by adivarup on Wed Feb 02, 2011 12:33 pm, edited 1 time in total.

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

Post by Marcus Tettmar » Fri Mar 24, 2006 6:09 pm

This should work:

WaitWindowOpen>Microsoft Internet Explorer
SetFocus>Microsoft Internet Explorer
Press Enter
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

adivarup
Junior Coder
Posts: 36
Joined: Tue Mar 21, 2006 10:04 pm

Post by adivarup » Fri Mar 24, 2006 6:22 pm

Hello,

Thank you again! I did try that setting and it did not work. I also tried using the Press ALT Press Enter and Press Esc... Many others.. I will PM you with the script and the url.

Thank you
________
how to saute
Last edited by adivarup on Wed Feb 02, 2011 12:34 pm, edited 1 time in total.

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Fri Mar 24, 2006 7:16 pm

I set up two pages as you suggest and mtettmar's code does close the popup.

adivarup
Junior Coder
Posts: 36
Joined: Tue Mar 21, 2006 10:04 pm

Post by adivarup » Fri Mar 24, 2006 7:20 pm

Well thats great to hear it works. But it does not work for me. Perhaps there is a security issue with IE and XP?
________
marijuana trichomes
Last edited by adivarup on Wed Feb 02, 2011 12:34 pm, edited 1 time in total.

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Fri Mar 24, 2006 7:29 pm

IE with XP is what I used. PM me the URL if you like and I'll try it.

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

Post by Marcus Tettmar » Fri Mar 24, 2006 9:13 pm

This script works fine:

// Generated by MacroScript WebRecorder 1.70
// Recorded on Friday, March 24, 2006, at 09:06 PM
LibLoad>IEAuto.dll,hIE
If>hIE=0
MessageModal>Could not load IEAuto.dll, make sure it is in the path or edit the LibLoad line.
Goto>end_script
EndIf

//Move the mouse cursor out of harm's way to avoid causing mouseover events to interrupt
MouseMove>0,0
Let>delay=1

LibFunc>hIE,CreateIE,IE[0],0

LibFunc>hIE,Navigate,r,%IE[0]%,http://www.xxxxxxxxxxx.com/
LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay

Let>FrameName={""}
Let>FormName={""}
Let>TagValue={"test.htm"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,A,TEXT,str:TagValue

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

Let>FrameName={""}
Let>FormName={""}
Let>TagValue={"Click Here"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,A,TEXT,str:TagValue

WaitWindowOpen>Microsoft Internet Explorer
SetFocus>Microsoft Internet Explorer
Press Enter

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

LibFree>hIE
Label>end_script

I have removed your URL that you sent me in the PM.

What might have been the problem is you might have had the WaitWindowOpen ... Press Enter code afdter the WaitIE function. This would cause it to wait forever, since IE is in a busy state WHILE the message box is active. So you need the keysend code immediately after the ClickTag and before the WaitIE code.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

adivarup
Junior Coder
Posts: 36
Joined: Tue Mar 21, 2006 10:04 pm

Post by adivarup » Fri Mar 24, 2006 10:00 pm

You guys make it seem so simple. I tested the new script and it does now work.

Thank you again!! Everyone who worked on this!
________
Leonard (appliances)

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