Search the Community
Showing results for tags 'ie11 ieattach'.
-
Hi I'm trying to write a simple script to (i) open a web page - stored in an object variable called $oIE (ii) enter some logon credentials (iii) click a submit button (iv) wait for the new page to open then attach it to the original $oIE object (effectively replacing the original $oIE object with a reference to the newly loaded page) (v) click a link that appears on the new page Now steps (i) to (iii) work a treat - no problem. But I can't get the next part working without adding a work around. Specifically this never exits the loop and an inspection of $oIE shows it contains the original page with the submit button on it. _IEAction($oSubmitButton, "click") _IELoadWait($oSubmitButton) _IELoadWait($oIE) ;while "QA" not in body text of page loop until it is $count=0 while NOT (StringInStr(_IEBodyReadText($oIE),"QA")) $count=$count+1 sleep(500) $oIE = _IEAttach("KeyAGENT","windowtitle") WEnd But if I add a message box like so _IEAction($oSubmitButton, "click") _IELoadWait($oSubmitButton) _IELoadWait($oIE) ;while "QA" not in body text of page loop until it is $count=0 while NOT (StringInStr(_IEBodyReadText($oIE),"QA")) $count=$count+1 sleep(500) Msgbox(0,"","works fine now") $oIE = _IEAttach("KeyAGENT","windowtitle") WEnd it works as expected ($count=2 on exit) I can swap the Msgbox lines for something like $iPID = Run("Notepad") Send("why??") ProcessClose ($iPID) I've tried embedded, url, title, instance variations of the _IEattach function but all have the same issue. What is going on and whats the best way to get this _IEAttach call to work? i.e to replace the original page stored in $oIE with the newly loaded page Thanks in advance - I'm pulling my hair out over this one.