harvlake Posted April 23, 2014 Share Posted April 23, 2014 Hi, I hope you can help me out. I am creating a script to open IE for a radio station then click a javascript button to open their popup player. Everything works fine, now how do I close the the individual windows when I am ready? Here is my code so far that works for opening the windows. Local $oIE = _IECreate("http://kykn.com") Local $PopupWindow = _IENavigate($oIE,"javascript:openPlayer('KYKN');") Thanks in advance. Link to comment Share on other sites More sharing options...
JohnOne Posted April 23, 2014 Share Posted April 23, 2014 Be specific about the individual window. And post whole code. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
harvlake Posted April 23, 2014 Author Share Posted April 23, 2014 (edited) Here is the full code I tried. By individual windows, I mean the original IE window and the Popup window. #include <Constants.au3> #include <IE.au3> #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.10.2 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- Local $oIE = _IECreate("http://kykn.com") Local $PopupWindow = _IENavigate($oIE,"javascript:openPlayer('KYKN');") WinWait(30000) _IEQuit($PopupWindow) MsgBox($MB_SYSTEMMODAL,"test","Ok") Edited April 23, 2014 by harvlake Link to comment Share on other sites More sharing options...
Danp2 Posted April 23, 2014 Share Posted April 23, 2014 You can't use the return value from _IENavigate like that. You will need to get a reference to the popup window (try _IEAttach) and then use that to close the window. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
JohnOne Posted April 23, 2014 Share Posted April 23, 2014 I'd probably try winclose for popup and of course _IEQuit for Created IE AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Palestinian Posted April 24, 2014 Share Posted April 24, 2014 The javascript button leads to static address I believe, you could use _IECreat with that address. #include <Constants.au3> #include <IE.au3> #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.10.2 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- Local $oIE = _IECreate("http://radio.securenetsystems.net/v5/KYKN") ;~ _IENavigate($oIE,"javascript:openPlayer('KYKN');") Sleep(30000) _IEQuit($oIE) MsgBox($MB_SYSTEMMODAL,"test","Ok") Link to comment Share on other sites More sharing options...
ahirbe Posted April 24, 2014 Share Posted April 24, 2014 I am trying to select a specific box in a multiple choice item, currently i have everything right except clicking the right box for the 3rd (ans3) and 4th (ans4) questions, my code only fills out the first choice for each question...here is my code #include <IE.au3> Call ("Vote") Func Vote () Global $oIE = _IECreate ("http://freeonlinesurveys.com/app/rendersurvey.asp?sid=zxus46gaw6qp49g452964&refer=") Local $vote1 = _IEGetObjByName ($oIE, "ans1") Local $vote2 = _IEGetObjByName ($oIE, "ans2") Local $vote3 = _IEGetObjByName ($oIE, "ans3") Local $vote4 = _IEGetObjByName ($oIE, "ans4") _IEFormElementSetValue ($vote1, "1") _IEFormElementSetValue ($vote2, "2") _IEFormElementSetValue ($vote3, "3") _IEFormElementSetValue ($vote4, "3") _IEAction ($vote1, "click") _IEAction ($vote2, "click") _IEAction ($vote3, "click") _IEAction ($vote4, "click") EndFunc Link to comment Share on other sites More sharing options...
Palestinian Posted April 25, 2014 Share Posted April 25, 2014 ahribe you obviously didn't read the forum rules, go have a look and then reconsider your question Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now