Jump to content

_IEQuit($oIE) does not close the browser


Recommended Posts

Hi, I am new in the AutoIT world.

I open an IE browser, I enter the credentials using the script and then send the Enter key (after that the site navigates to another page)

When I finish I want to close the browser using _IEQuit($oIE) but it does not work.

What I found is that it works if I call _IEQuit before sending the Enter key 

Here is my code.

What I am doing wrong?

 

#include <IE.au3>
#include <MsgBoxConstants.au3>


main()

func main()
Local $oIE = _IECreate("http://misite.com/Login/Login.aspx")
Local $oForm = _IEFormGetObjByName($oIE, "Form1")
Local $oUsuario = _IEFormElementGetObjByName($oForm, "txtuser")
Local $oClave = _IEFormElementGetObjByName($oForm, "txtPassword")

_IEFormElementSetValue($oUsuario, "userXYZ")
_IEFormElementSetValue($oClave, "thePassword")

Send("{ENTER}")
Sleep(1000)
#cs
here I do some other stuff.
#ce
_IEQuit($oIE)
EndFunc

 

Link to comment
Share on other sites

3 minutes ago, Danp2 said:

Why aren't you using _IEFormSubmit instead of Send?

Because the site I am automating is very old, in fact, I have to run it with IE5 compatibility. If I use _IEFormSubmit the submit does not work, It does like a refresh page and the password is cleared.

 

 

Link to comment
Share on other sites

1 hour ago, Nine said:

After the ENTER key is sent, try reattaching to site with _IEAttach or navigating to the new url with _IENavigate...

Sorry I am new in AutoIT. 

I tried the following:

$oIE = _IEAttach("http://theNewPageRedirected.com/Login/Frames.aspx","url")

I am not sure if the use of _IEAttach is fine here, but it does not work.

 

Link to comment
Share on other sites

54 minutes ago, FranciscoG said:

I am not sure if the use of _IEAttach is fine here, but it does not work. 

It's difficult to provide meaningful feedback to "does not work". What doesn't work (the _IEAttach or the _IEQuit)?

2 hours ago, Danp2 said:

You haven't mentioned any errors appearing in the Scite output panel. Any errors showing up? 

Please answer this.

2 hours ago, FranciscoG said:

#cs here I do some other stuff. #ce

Does this "other stuff" involve IE automation? If so, I'm assuming that your efforts to use $oIE at this stage are successful. Is that correct?

Link to comment
Share on other sites

When you say "it does not work", you must give us something to understand.  The first thing you must do is provide the snippet of your trial, and a copy of the scite console. A screen capture of the DOM would be appreciated.  Help us to help you...

Edit Danp2 beat me on it lol

Edited by Nine
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...