
picorico2
Members-
Posts
19 -
Joined
-
Last visited
Everything posted by picorico2
-
Wow, I´ve must have missed it. Thanks buddy.
- 26 replies
-
Please my friend, help me make a code just to run a website and wait until it loads completely and then move on. I´m a newbie and I just started learning programming but I want to get this done to facilitate my morning job.
- 26 replies
-
I´m more confused now than before... Anybody?
- 26 replies
-
I read the whole Webdrive wiki entry but I´m still confused. I believe I have the Marionette feature turned on, because I ran the demo and it went ok. And I understand that using Webdrive is better than the Autoit commands, that´s why I´m trying to replace all the code with it. Please help me to correct my code or plase make one new just to wait for a web site to load completely and then continue with the script. Thanks bro.
- 26 replies
-
Ok. I removed the debugging mode. I commented out the line containing the _WD_CreateSession because I don´t want to open a new Firefox Windows, I just want to move to the next tab on the right, open a web site, wait for it to finish loading and move on, and finally I don´t undertand about variables and declarations pls help me to fix the code, and also can you tell me what´s the meaning of "DesiredCapabilities" sound funny to me. English is not my first language. The main reason I want to use Webdrive is because sometimes the web site I´m trying to access in Firefox takes longer to completely load than usual so if I use "Sleep" is not very accurate. Thank you kindly.
- 26 replies
-
Sorry about before, I learned something new today. Thank you and I´ll be waiting for your kind help.
- 26 replies
-
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Compile_Both=y #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.5 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <MsgBoxConstants.au3> #include <wd_core.au3> #include <wd_helper.au3> #include <GuiComboBoxEx.au3> #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> HotKeySet("{Esc}", "ExitScript") $_WD_DEBUG = $_WD_DEBUG_None ; You could also use $_WD_DEBUG_Error ; Here you can specify some browser specific settings... you'll need to research them depending on your browser ; ... or just copy paste someone else's code :D #Region Settings Setup _WD_Option('Driver', 'C:\Program Files (x86)\AutoIt3\Include\geckodriver.exe') _WD_Option('DriverParams', '--log trace') _WD_Option('Port', 4444) Global $sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true}}' #EndRegion Settings Setup ; You need to initialize some stuff with this UDF _WD_Startup() ; If there is an error setting stuff up, then exit If @error <> $_WD_ERROR_Success Then Exit -1 EndIf ; Create a new instance of a browser with some settings you request ;Global $sSession = _WD_CreateSession($sDesiredCapabilities) ; If there was an error, exit ;If Not (@error = $_WD_ERROR_Success) Then Exit MsgBox($MB_ICONERROR, "Error: _WD_CreateSession", "Failed to create a Session. Check your desired capabilities.") Local $sDestination = "E:\Documentos\AUTOIT\palomitav.jpg" Local $sDesiredCapabilities, $iIndex, $sSession ;Verificar si la serie es correcta MsgBox($MB_SYSTEMMODAL, "Serie", "Favor de copiar la serie y dar clic en Aceptar") SplashTextOn("", "Verificando la serie en Pago Referenciado...", 200, 60, 1400, 5, 600, 60, opt = 1) ; Ancho_Ven, Alto_Ven Y, Send("^{TAB}") _WD_LoadWait($sSession, "https://guerrero.gob.mx/Pry_PagoReferenciado/Administracion/indexMs.php") Send("{TAB 3}") Sleep(1000) Send("{ENTER}") _WD_LoadWait($sSession, "https://guerrero.gob.mx/Pry_PagoReferenciado/Administracion/menuOper.php") MouseMove(1047, 115, 5) MouseMove(1047, 145, 5) MouseMove(1223, 145, 5) MouseMove(1223, 170, 5) MouseClick("left") _WD_LoadWait($sSession, "https://guerrero.gob.mx/Pry_PagoReferenciado/Administracion/PagoTenencia/tenencia2015/admin.php") Send("{TAB}") Send("^v") MouseMove(404, 224, 5) MouseClick("left") SplashOff() $a = MsgBox(4, "", "¿Es correcta la serie?") If $a = 6 Then ;SI ;MouseMove(309, 476, 5) ;MouseClick("left") Send("{TAB 6}") ;Sleep(500) Send("{DOWN 3}") Send("{TAB}") Send("{ENTER}") Send("{TAB}") Send("{ENTER}") _WD_LoadWait($sSession, "https://guerrero.gob.mx/Pry_PagoReferenciado/Administracion/PagoTenencia/tenencia2015/index.php?i=3&usu=570&serie=8AFDR5ADXA6284122&sid=0.29255510000995255") Send("{END}") ElseIf $a = 7 Then ;NO Send("^+{TAB}") MsgBox($MB_SYSTEMMODAL, "Placa", "Favor de copiar la PLACA y dar clic en Aceptar") Send("^{TAB}") MouseMove(425, 226, 5) MouseClick("left") Sleep(1000) Send("{TAB}") Send("^v") Sleep(10000) $a = MsgBox(4, "", "¿Es correcta la placa?") If $a = 6 Then ;SI MouseMove(95, 295, 5) MouseClick("left") MouseMove(404, 224, 5) MouseClick("left") MouseMove(309, 517, 5) MouseClick("left") Sleep(1000) Send("{DOWN 3}") Send("{ENTER}") Sleep(1000) Send("{TAB}") Send("{ENTER}") Sleep(1000) Send("{TAB 2}") Send("{ENTER}") Sleep(4000) Send("{END}") ElseIf $a = 7 Then ;NO ;WinActivate ("Cobro de Tenencia ::: Sistema Pago Referenciado - Mozilla Firefox") Sleep(1000) Send("^+{TAB}") Send("r") Sleep(3000) Send("El número de serie y placa son incorrectos") EndIf EndIf Func ExitScript() Exit EndFunc ;==>ExitScript
- 26 replies
-
Hi there again, Now for some unknown reason it has stopped working It doesn´t open the web page anymore and continues the script. Here's my code: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Compile_Both=y #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.5 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <MsgBoxConstants.au3> #include <wd_core.au3> #include <wd_helper.au3> #include <GuiComboBoxEx.au3> #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> HotKeySet("{Esc}", "ExitScript") $_WD_DEBUG = $_WD_DEBUG_None ; You could also use $_WD_DEBUG_Error ; Here you can specify some browser specific settings... you'll need to research them depending on your browser ; ... or just copy paste someone else's code #Region Settings Setup _WD_Option('Driver', 'C:\Program Files (x86)\AutoIt3\Include\geckodriver.exe') _WD_Option('DriverParams', '--log trace') _WD_Option('Port', 4444) Global $sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true}}' #EndRegion Settings Setup ; You need to initialize some stuff with this UDF _WD_Startup() ; If there is an error setting stuff up, then exit If @error <> $_WD_ERROR_Success Then Exit -1 EndIf ; Create a new instance of a browser with some settings you request ;Global $sSession = _WD_CreateSession($sDesiredCapabilities) ; If there was an error, exit ;If Not (@error = $_WD_ERROR_Success) Then Exit MsgBox($MB_ICONERROR, "Error: _WD_CreateSession", "Failed to create a Session. Check your desired capabilities.") Local $sDestination = "E:\Documentos\AUTOIT\palomitav.jpg" Local $sDesiredCapabilities, $iIndex, $sSession ;Verificar si la serie es correcta MsgBox($MB_SYSTEMMODAL, "Serie", "Favor de copiar la serie y dar clic en Aceptar") SplashTextOn("", "Verificando la serie en Pago Referenciado...", 200, 60, 1400, 5, 600, 60, opt = 1) ; Ancho_Ven, Alto_Ven Y, Send("^{TAB}") _WD_LoadWait($sSession, "https://guerrero.gob.mx/Pry_PagoReferenciado/Administracion/indexMs.php") Send("{TAB 3}") Sleep(1000) Send("{ENTER}") _WD_LoadWait($sSession, "https://guerrero.gob.mx/Pry_PagoReferenciado/Administracion/menuOper.php") MouseMove(1047, 115, 5) MouseMove(1047, 145, 5) MouseMove(1223, 145, 5) MouseMove(1223, 170, 5) MouseClick("left") _WD_LoadWait($sSession, "https://guerrero.gob.mx/Pry_PagoReferenciado/Administracion/PagoTenencia/tenencia2015/admin.php") Send("{TAB}") Send("^v") MouseMove(404, 224, 5) MouseClick("left") SplashOff() $a = MsgBox(4, "", "¿Es correcta la serie?") If $a = 6 Then ;SI ;MouseMove(309, 476, 5) ;MouseClick("left") Send("{TAB 6}") ;Sleep(500) Send("{DOWN 3}") Send("{TAB}") Send("{ENTER}") Send("{TAB}") Send("{ENTER}") _WD_LoadWait($sSession, "https://guerrero.gob.mx/Pry_PagoReferenciado/Administracion/PagoTenencia/tenencia2015/index.php?i=3&usu=570&serie=8AFDR5ADXA6284122&sid=0.29255510000995255") Send("{END}") ElseIf $a = 7 Then ;NO Send("^+{TAB}") MsgBox($MB_SYSTEMMODAL, "Placa", "Favor de copiar la PLACA y dar clic en Aceptar") Send("^{TAB}") MouseMove(425, 226, 5) MouseClick("left") Sleep(1000) Send("{TAB}") Send("^v") Sleep(10000) $a = MsgBox(4, "", "¿Es correcta la placa?") If $a = 6 Then ;SI MouseMove(95, 295, 5) MouseClick("left") MouseMove(404, 224, 5) MouseClick("left") MouseMove(309, 517, 5) MouseClick("left") Sleep(1000) Send("{DOWN 3}") Send("{ENTER}") Sleep(1000) Send("{TAB}") Send("{ENTER}") Sleep(1000) Send("{TAB 2}") Send("{ENTER}") Sleep(4000) Send("{END}") ElseIf $a = 7 Then ;NO ;WinActivate ("Cobro de Tenencia ::: Sistema Pago Referenciado - Mozilla Firefox") Sleep(1000) Send("^+{TAB}") Send("r") Sleep(3000) Send("El número de serie y placa son incorrectos") EndIf EndIf Func ExitScript() Exit EndFunc ;==>ExitScript
- 26 replies
-
Works like a CHARM. Thank you very much Sir. We´ll keep in touch.
- 26 replies
-
Same error, here's the line _WD_Option('Driver', 'C:\Program Files (x86)\AutoIt3\Include\geckodriver.exe')
- 26 replies
-
I get this error with your script _WD_Startup ==> Invalid value: Location for Web Driver not set.
- 26 replies
-
Excellent my friend, and thank you. I´ll try my best.
- 26 replies
-
Good Morning Danp2, I got an error that says that I haven´t declared the variable so I copied the line below from your demo but still doesn´t do anything Local $sDesiredCapabilities, $iIndex, $sSession Here's the code: #include "wd_core.au3" #include "wd_helper.au3" #include <GuiComboBoxEx.au3> #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> Local $sDesiredCapabilities, $iIndex, $sSession _WD_Navigate($sSession, "https://guerrero.gob.mx/Pry_PagoReferenciado/Administracion/indexMs.php") _WD_LoadWait($sSession) Like I said I´m a newbie but I want to learn, pls be patient. 😄
- 26 replies
-
Thanks for the early reply, Its an honor that the creator of the Web Driver has answered me. I just want to open a web page, and pause the script until it fully loads. and do I have to use the line below (I'm a newbie) $sSession = _WD_CreateSession($sDesiredCapabilities) Please post an example.
- 26 replies
-
Hi all, I´m trying to use the command "WD_LoadWait" because I want to pause the script until the web page fully loads in Firefox but I don´t know how to use it. Here´s the full help ; #FUNCTION# ==================================================================================================================== ; Name ..........: _WD_LoadWait ; Description ...: Wait for a browser page load to complete before returning ; Syntax ........: _WD_LoadWait($sSession[, $iDelay = 0[, $iTimeout = -1[, $sElement = '']]]) ; Parameters ....: $sSession - Session ID from _WDCreateSession ; $iDelay - [optional] Milliseconds to wait before checking status ; $iTimeout - [optional] Period of time to wait before exiting function ; $sElement - [optional] Element ID to confirm DOM invalidation ; Return values .: Success - 1 ; Failure - 0 and sets the @error flag to non-zero ; Author ........: Dan Pollak ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _WD_LoadWait($sSession, $iDelay = Default, $iTimeout = Default, $sElement = Default) Local Const $sFuncName = "_WD_LoadWait" Local $iErr, $sResponse, $oJSON, $sReadyState If $iDelay = Default Then $iDelay = 0 If $iTimeout = Default Then $iTimeout = $_WD_DefaultTimeout If $sElement = Default Then $sElement = "" If $iDelay Then Sleep($iDelay) Local $hLoadWaitTimer = TimerInit() While True If $sElement <> '' Then _WD_ElementAction($sSession, $sElement, 'name') If $_WD_HTTPRESULT = $HTTP_STATUS_NOT_FOUND Then $sElement = '' Else $sResponse = _WD_ExecuteScript($sSession, 'return document.readyState', '') $iErr = @error If $iErr Then ExitLoop EndIf $oJSON = Json_Decode($sResponse) $sReadyState = Json_Get($oJSON, "[value]") If $sReadyState = 'complete' Then ExitLoop EndIf If (TimerDiff($hLoadWaitTimer) > $iTimeout) Then $iErr = $_WD_ERROR_Timeout ExitLoop EndIf Sleep(100) WEnd If $iErr Then Return SetError(__WD_Error($sFuncName, $iErr, ""), 0, 0) EndIf Return SetError($_WD_ERROR_Success, 0, 1) EndFunc Any sugestions or examples?
- 26 replies
-
Trying to understand Winactivate
picorico2 replied to picorico2's topic in AutoIt General Help and Support
Thank you, I´ll dive into it. -
Trying to understand Winactivate
picorico2 replied to picorico2's topic in AutoIt General Help and Support
Thank you JLogan3o13 for the early response, Can you please give me an example how to use it? What I want is to activate a PDF window so I can move it to a certain position, ej. the thing is that it´s going to have a different name file everytime it opens. The code is the same as above. In the meantime I´ll try to play with Winlist. -
Hi there! I a noob. I´m tring to open, move and resize a PDF document window but I can´t bring a windows to the front using Winactivate, and since every document has a different name, I don´t fully undestand the "title" and "text" options. Pls help Here is my code: WinActivate ("[CLASS:Afx:00007FF793120000:8:0000000000010003:0000000000000000:00000000018D025D]") WinMove ("", "Nitro Pro", 28, 0, 1340, 858)
-
Hi there, I´m new to Autoit so I'm trying to use the following code in Firefox but I when I run it, it always start Internet Explorer. What I want to do is open a new tab in firefox and wait until it finishes loading before continuing with the script. Any ideas? Thanks. #include <IE.au3> $oIE = _IECreate() _IENavigate($oIE, "www.autoitscript.com")