krzyche Posted January 13, 2022 Share Posted January 13, 2022 Hello, I'm a new to Autoit, i like very much the idea of automatization of work. 😀 For my first task I wanted to automate to process to login to my work VPN. Everything is working fine up to the moment of getting the name of the forms from IE, I've cut out my code, to the error lines - I want to get collection of the forms on that page, but this code itself is giving me an error: #include <IE.au3> $oIE = _IECreate("https://aecom.okta.com/signin/") Sleep(5000) $oForm = _IEFormGetCollection($oIE)  Error msg: Line 1785 Return SetError($_IESTATUS_Success, 0, $oObject.document) Return SetError($_IESTATUS_Success, 0, $oObject.^) ERROR Error: The requested action with this object has failed. Can someone advise me what I'm doing wrong? Link to comment Share on other sites More sharing options...
Luke94 Posted January 13, 2022 Share Posted January 13, 2022 (edited) Does this throw the same error? ; Get a reference to the collection of forms on a page, ; and then loop through them displaying information for each #include <IE.au3> #include <MsgBoxConstants.au3> Local $oIE = _IECreate("https://aecom.okta.com/signin/") Local $oForms = _IEFormGetCollection($oIE) MsgBox($MB_SYSTEMMODAL, "Forms Info", "There are " & @extended & " form(s) on this page") For $oForm In $oForms MsgBox($MB_SYSTEMMODAL, "Form Info", $oForm.name) Next Above is Example 2 of _IEFormGetCollection. Might be worth registering a error handler. Do a search for _IEErrorHandlerRegister. Edited January 13, 2022 by Luke94 Link to comment Share on other sites More sharing options...
krzyche Posted January 13, 2022 Author Share Posted January 13, 2022 Yes, using you code, I'm getting the same error. I haven't search for the _IEErrorHandlerRegister, I don't know how to use that... Link to comment Share on other sites More sharing options...
Luke94 Posted January 13, 2022 Share Posted January 13, 2022 I assume IE appears and loads the webpage, correct? Run this and let us know the output: ; Get a reference to the collection of forms on a page, ; and then loop through them displaying information for each #include <IE.au3> #include <MsgBoxConstants.au3> _IEErrorHandlerRegister('_Error') Local $oIE = _IECreate("https://aecom.okta.com/signin/") Local $oForms = _IEFormGetCollection($oIE) MsgBox($MB_SYSTEMMODAL, "Forms Info", "There are " & @extended & " form(s) on this page") For $oForm In $oForms MsgBox($MB_SYSTEMMODAL, "Form Info", $oForm.name) Next Func _Error($oError) ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> COM error handler - COM Error intercepted !" & @CRLF & _ @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _ @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF) EndFunc  Link to comment Share on other sites More sharing options...
krzyche Posted January 13, 2022 Author Share Posted January 13, 2022 Page is loading correctly. After using your code I'm getting a response "There are 0 forms(s) on this page", But there are visible login and password fields right on this page. Link to comment Share on other sites More sharing options...
Luke94 Posted January 13, 2022 Share Posted January 13, 2022 Was there no output in the SciTE console? Link to comment Share on other sites More sharing options...
krzyche Posted January 13, 2022 Author Share Posted January 13, 2022 expandcollapse popup--> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_ClientDisconnected (-2147023174, Browser has been deleted prior to operation.) Forum.au3 (1785) : ==> COM error handler - COM Error intercepted ! err.number is: 0x800706BA err.windescription: The RPC server is unavailable. err.description is: err.source is: err.helpfile is: err.helpcontext is: err.lastdllerror is: 0 err.scriptline is: 1785 err.retcode is: 0x00000000 Forum.au3 (907) : ==> COM error handler - COM Error intercepted ! err.number is: 0x000000A9 err.windescription: Variable must be of type 'Object'. err.description is: err.source is: err.helpfile is: err.helpcontext is: err.lastdllerror is: 0 err.scriptline is: 907 err.retcode is: 0x00000000 Forum.au3 (907) : ==> COM error handler - COM Error intercepted ! err.number is: 0x000000A9 err.windescription: Variable must be of type 'Object'. err.description is: err.source is: err.helpfile is: err.helpcontext is: err.lastdllerror is: 0 err.scriptline is: 907 err.retcode is: 0x00000000 Forum.au3 (12) : ==> COM error handler - COM Error intercepted ! err.number is: 0x000000A9 err.windescription: Variable is not of type 'Object'. err.description is: err.source is: err.helpfile is: err.helpcontext is: err.lastdllerror is: 0 err.scriptline is: 12 err.retcode is: 0x00000000 >Exit code: 0 Time: 9.82 After pressing F5 I'm getting a bunch of errors. Page is still loading properly. Link to comment Share on other sites More sharing options...
Luke94 Posted January 13, 2022 Share Posted January 13, 2022 (edited) What Operating System are you using? A potential fix:Â https://answers.microsoft.com/en-us/windows/forum/all/error-code-0x800806ba-the-rpc-server-is-not/aecea29e-0f57-42cd-b5d1-7b2717374375 Edited January 13, 2022 by Luke94 Link to comment Share on other sites More sharing options...
krzyche Posted January 13, 2022 Author Share Posted January 13, 2022 I'm using Windows 10. I have the RPC service running, I've done this instruction: Quote  Method 1: The RPC (Remote Procedure Call) service in Services should be started and the startup type should be set to Automatic. Steps: a. Press Windows key + R. b. Type services.msc c. In the Services window, find Remote Procedure Call and right click on it to select Properties. d. Under the General tab make sure the Startup type is Automatic and the Service status says Started.  I will try do the same on a different computer to see if if works. Link to comment Share on other sites More sharing options...
Luke94 Posted January 13, 2022 Share Posted January 13, 2022 A few more solutions here. Link to comment Share on other sites More sharing options...
Danp2 Posted January 13, 2022 Share Posted January 13, 2022 Have you tried using _IEAttach to reestablish the connection? #include <IE.au3> _IECreate("https://aecom.okta.com/signin/") $oIE = _IEAttach("AECOM") $oForms = _IEFormGetCollection($oIE)   WebDriver UDF [GH&S]  Latest version Wiki FAQs Link to comment Share on other sites More sharing options...
krzyche Posted January 13, 2022 Author Share Posted January 13, 2022 Interestingly on the other computer the code is working without any errors and it result of showing 2 forms. I'm not sure what setting on the first computer is preventing from working. I've done pretty everything that was linked here: 36 minutes ago, Luke94 said: A few more solutions here. I'm having the Symantec Endpoint Protection, but I've turned that off, and it's still the same. The services are working normally... Link to comment Share on other sites More sharing options...
krzyche Posted January 13, 2022 Author Share Posted January 13, 2022 Ok, I have found something really interesting. When I run the program SciTE as an Administrator it works fine. Otherwise, just by double clicking it, there will be an RPC error. Link to comment Share on other sites More sharing options...
krzyche Posted January 13, 2022 Author Share Posted January 13, 2022 Does anyone now what rights to add to my windows account to have working RCP ? I doubt I need to be a admin to run the Autoit script. 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