JuanFelipe Posted August 31, 2020 Posted August 31, 2020 Hello gyus, I try to make a code to login in a web page in my job, buy i can’t understand why my form is blocked, this is my code: expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <StringConstants.au3> #include <WindowsConstants.au3> #include <WinAPIFiles.au3> #include <FileConstants.au3> #include <File.au3> #include <Array.au3> #include <IE.au3> #include <Excel.au3> #include <GuiEdit.au3> #include <GuiStatusBar.au3> #include <DateTimeConstants.au3> #include <Date.au3> #Region ### START Koda GUI section ### Form=C:\noentry\koda_1.7.3.0\Forms\spoa.kxf $Form1 = GUICreate("Eva y Vehículos", 1200, 1000, 10, 10) $prueba = GUICtrlCreateButton("Prueba",10,990,50,20) ;VARIABLES ========================================================================================== $psi = "https://psi.policia.gov.co/PSI/Login.aspx?ReturnUrl=%2fPSI#no-back-button" $chequeVehiculos = "https://psi.policia.gov.co/PSI/frm_lista_chk.aspx" $evaluacionEva = "https://psi.policia.gov.co/PSI/eva_frmver.aspx" $oIE = ObjCreate("Shell.Explorer.2") $GUIActiveX = GUICtrlCreateObj ($oIE, 10, 10, 1180, 980) ;GUICtrlSetState(-1, $GUI_DISABLE) GUISetState(@SW_SHOW) $oIE.navigate($psi) ;_IELoadWait($oIE) _InicioSesion() #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $prueba _InicioSesion() EndSwitch WEnd Func _InicioSesion() Local $username = _IEGetObjByName($oIE, "txtUsuario") Local $pass = _IEGetObjByName($oIE, "txtClave") Local $logina = _IEGetObjByName($oIE, "btnIngresar") $username.value="example" $pass.value="examplepass" _IEAction($logina, 'click') _IELoadWait($oIE) MsgBox(16,"","") EndFunc
Developers Jos Posted August 31, 2020 Developers Posted August 31, 2020 (edited) Moved to the appropriate forum. What would it take for you to think and select the proper forum? We have now moved enough of your topics for you to sort of understand where the need to go. Moderation Team Edited August 31, 2020 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Danp2 Posted August 31, 2020 Posted August 31, 2020 22 minutes ago, JuanFelipe said: i can’t understand why my form is blocked What exactly do you mean by that? Are you receiving an error? Does the GUI appear, but without the embedded website? Or what? Latest Webdriver UDF Release Webdriver Wiki FAQs
Nine Posted August 31, 2020 Posted August 31, 2020 Have you tried firing event after setting value : $oObject.fireEvent("OnChange") $oObject.fireEvent("OnClick") “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) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
JuanFelipe Posted August 31, 2020 Author Posted August 31, 2020 4 hours ago, Danp2 said: What exactly do you mean by that? Are you receiving an error? Does the GUI appear, but without the embedded website? Or what? I don't get any error, the page loads when the GUI starts, but after the page loads it doesn't execute anything, it's like the page never finished loading.
JuanFelipe Posted August 31, 2020 Author Posted August 31, 2020 4 hours ago, Nine said: Have you tried firing event after setting value : $oObject.fireEvent("OnChange") $oObject.fireEvent("OnClick") No, can you explain me how to use? please. 🤓
Danp2 Posted August 31, 2020 Posted August 31, 2020 It could possibly be a compatibility issue due. You could look at the following thread for how to adjust the version of IE that gets used -- Latest Webdriver UDF Release Webdriver Wiki FAQs
Nine Posted August 31, 2020 Posted August 31, 2020 Sigh...like this : Local $username = _IEGetObjByName($oIE, "txtUsuario") $username.value="example" $username.fireEvent("OnChange") $username.fireEvent("OnClick") You definitely need to make some brain effort. Otherwise...whatever “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) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
JuanFelipe Posted September 2, 2020 Author Posted September 2, 2020 On 8/31/2020 at 6:00 PM, Nine said: Sigh...like this : Local $username = _IEGetObjByName($oIE, "txtUsuario") $username.value="example" $username.fireEvent("OnChange") $username.fireEvent("OnClick") You definitely need to make some brain effort. Otherwise...whatever For you to speak to me like this, I suppose you think you are a superior person. The problem is that after the $ oIE.navigate ($ psi) it doesn't execute anything else.
Danp2 Posted September 2, 2020 Posted September 2, 2020 When I run your code as posted, the script fails with a hard error in the first _IEGetObjByName because the page hasn't completed loading. It works correctly for me when I uncomment the _IELoadWait line. If you are experiencing something completely different, then this sounds like a localized issue that you will need to troubleshoot. Latest Webdriver UDF Release Webdriver Wiki FAQs
JuanFelipe Posted September 2, 2020 Author Posted September 2, 2020 3 hours ago, Danp2 said: When I run your code as posted, the script fails with a hard error in the first _IEGetObjByName because the page hasn't completed loading. It works correctly for me when I uncomment the _IELoadWait line. If you are experiencing something completely different, then this sounds like a localized issue that you will need to troubleshoot. When you uncomment _IELoadWait you put XXXX in the user space?. My problem is that so you have uncomment the line after the $oIE.navigate($psi does nothing, it stays waiting for the page to load harmlessly.
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