FranciscoG Posted July 18, 2019 Share Posted July 18, 2019 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 More sharing options...
Danp2 Posted July 18, 2019 Share Posted July 18, 2019 Why aren't you using _IEFormSubmit instead of Send? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
FranciscoG Posted July 18, 2019 Author Share Posted July 18, 2019 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 More sharing options...
Nine Posted July 18, 2019 Share Posted July 18, 2019 After the ENTER key is sent, try reattaching to site with _IEAttach or navigating to the new url with _IENavigate... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Danp2 Posted July 18, 2019 Share Posted July 18, 2019 No way to know for sure with the limited information provided. You haven't mentioned any errors appearing in the Scite output panel. Any errors showing up? Have you tried reattaching with _IEAttach (as indicated above by @Nine)? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
FranciscoG Posted July 18, 2019 Author Share Posted July 18, 2019 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 More sharing options...
Danp2 Posted July 18, 2019 Share Posted July 18, 2019 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? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Nine Posted July 18, 2019 Share Posted July 18, 2019 (edited) 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 July 18, 2019 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy 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