Ayuda soy nuevo en esto

y programas personales para otros como tu, puede que te corrijan ;)

Ayuda soy nuevo en esto

Notapor darioreg » 12 Oct 2016, 20:48

Hola, a quien pueda ayudarme, recién me estoy iniciando en esto del autoit y tengo el siguiente problema que no puedo resolver. Al ingresar a una página con contraseña y usuario, hago todos los pasos para que cargue los mismos, pero al momento de hacer "clic" en el ingreso no ocurre esto, por favor ayuda. Les copio el codigo fuente de la pagina (http://www.justiciacordoba.gob.ar/justi ... qzpV3Mtg==):



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
Justicia Córdoba
</title>
<!--[if lt IE 7]>
<script src="http://ie7-js.googlecode.com/svn/version/2.0(beta)/IE7.js" type="text/javascript"></script>
<![endif]-->
<meta content="text/html; charset=windows-1252" http-equiv="Content-Type" />
<script src="../ScriptsCliente/Funciones.js" type="text/javascript"></script>
<script src="../ScriptsCliente/Validacion.js" type="text/javascript"></script>
<script src="../Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
<script src="../Scripts/jquery-ui-1.8.11.custom.min.js" type="text/javascript"></script>
<script src="../Scripts/dialog/webDialog.js" type="text/javascript"></script>
<link href="../css/jquery.UI/jquery-ui.css" rel="stylesheet" type="text/css" /><link href="../CSS/General.css" rel="stylesheet" type="text/css" /><link href="../CSS/CargaWeb.css" rel="stylesheet" type="text/css" /><link href="../Extranet/jcstyle.css" rel="stylesheet" type="text/css" />
<script src="../Scripts/Functions.js" type="text/javascript"></script>
<script src="../Scripts/showCourtain.js"></script>
<script src="../Scripts/MyToolTip.js"></script>
<meta http-equiv="Page-Exit" content="blendTrans(Duration=0.1)" /></head>
<body onload="try{OnLoad()}catch(e){};window.focus(this)" onunload="try{OnUnload()}catch(e){}">


<form method="post" action="./Login.aspx?ReturnUrl=%2fmarcopolo%2f_CuentasJudiciales%2fCuentasJudicialesAlta.aspx" id="aspnetForm" onsubmit="showCourtain({loadingImg: '../images/ajax-loader.gif'});return true;">
<div class="aspNetHidden">
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTE2Mjg2MjIyMA9kFgJmD2QWAgIFD2QWAgIDD2QWAgIBD2QWAgIDDw8WAh4EVGV4dGVkZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQUjY3RsMDAkY3BoRGV0YWxsZSRjdHJsTG9naW4kYnRuTG9nSW7IEt0w/QSxhdeZJXXgdnItaxZqpw==" />
</div>

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['aspnetForm'];
if (!theForm) {
theForm = document.aspnetForm;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>


<script src="/JusticiaCordoba/WebResource.axd?d=37eIWgb8Sr3RDa5uRok6QMKFZdKJIS0uTp4CxycXY-jCAWp0v1NHX86Y9P24tpnN6100kDVT3JitecCL6UuZKHC-Pis1&amp;t=635802961220000000" type="text/javascript"></script>


<script type="text/javascript">
//<![CDATA[
var __cultureInfo = {"name":"es-AR","numberFormat":{"CurrencyDecimalDigits":2,"CurrencyDecimalSeparator":",","IsReadOnly":true,"CurrencyGroupSizes":[3],"NumberGroupSizes":[3],"PercentGroupSizes":[3],"CurrencyGroupSeparator":".","CurrencySymbol":"$","NaNSymbol":"NeuN","CurrencyNegativePattern":2,"NumberNegativePattern":1,"PercentPositivePattern":0,"PercentNegativePattern":0,"NegativeInfinitySymbol":"-Infinito","NegativeSign":"-","NumberDecimalDigits":2,"NumberDecimalSeparator":",","NumberGroupSeparator":".","CurrencyPositivePattern":2,"PositiveInfinitySymbol":"Infinito","PositiveSign":"+","PercentDecimalDigits":2,"PercentDecimalSeparator":",","PercentGroupSeparator":".","PercentSymbol":"%","PerMilleSymbol":"‰","NativeDigits":["0","1","2","3","4","5","6","7","8","9"],"DigitSubstitution":1},"dateTimeFormat":{"AMDesignator":"a.m.","Calendar":{"MinSupportedDateTime":"\/Date(-62135586000000)\/","MaxSupportedDateTime":"\/Date(253402300799999)\/","AlgorithmType":1,"CalendarType":1,"Eras":[1],"TwoDigitYearMax":2029,"IsReadOnly":true},"DateSeparator":"/","FirstDayOfWeek":0,"CalendarWeekRule":0,"FullDateTimePattern":"dddd, dd\u0027 de \u0027MMMM\u0027 de \u0027yyyy hh:mm:ss tt","LongDatePattern":"dddd, dd\u0027 de \u0027MMMM\u0027 de \u0027yyyy","LongTimePattern":"hh:mm:ss tt","MonthDayPattern":"dd MMMM","PMDesignator":"p.m.","RFC1123Pattern":"ddd, dd MMM yyyy HH\u0027:\u0027mm\u0027:\u0027ss \u0027GMT\u0027","ShortDatePattern":"dd/MM/yyyy","ShortTimePattern":"hh:mm tt","SortableDateTimePattern":"yyyy\u0027-\u0027MM\u0027-\u0027dd\u0027T\u0027HH\u0027:\u0027mm\u0027:\u0027ss","TimeSeparator":":","UniversalSortableDateTimePattern":"yyyy\u0027-\u0027MM\u0027-\u0027dd HH\u0027:\u0027mm\u0027:\u0027ss\u0027Z\u0027","YearMonthPattern":"MMMM\u0027 de \u0027yyyy","AbbreviatedDayNames":["dom","lun","mar","mié","jue","vie","sáb"],"ShortestDayNames":["do","lu","ma","mi","ju","vi","sá"],"DayNames":["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],"AbbreviatedMonthNames":["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic",""],"MonthNames":["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],"IsReadOnly":true,"NativeCalendarName":"calendario gregoriano","AbbreviatedMonthGenitiveNames":["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic",""],"MonthGenitiveNames":["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""]},"eras":[1,"d.C.",null,0]};//]]>
</script>

<script src="/JusticiaCordoba/ScriptResource.axd?d=QbUvLB6xg_Yx2F1TwI1H40d67KBeQW_5T8IqgWFNGM9xbpp0bCWOxKG4P8Jvj9Wz2135ZyCGxfNKN7D-9Vb1t43Ro71CYrLmXtTK1O5IC4jh_oNuOQ1z--f-xsc0tuSuwCfQ7XdRxlUXwPQO13HQisKIIvI1&amp;t=5f9d5645" type="text/javascript"></script>
<script src="/JusticiaCordoba/ScriptResource.axd?d=VA8-6dKPvtwpurviaQ75k3P6cmq_EFO--u3ifqcwWAZylaU-zTvQ1U1cGO3E-CpNyzf9CDUGzA2wK1Ebdl7k2TqXXY6T80uTQS3-LbiLPw9ajWnqv7tOefje4eUdTjGyRp6P06T4R1l1eXT90wf97Vp2TcsntlUrlQocyotU4wi0xtbk0&amp;t=5f9d5645" type="text/javascript"></script>
<div class="aspNetHidden">

<input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="33EDCCB1" />
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEdAAS04QafHVQ8e/RnqCTjwx0xTrKJkt04YY3qLI8pAcIoDpsZqXqKjiJiIYEAwUsB7ew7J7/sZdIAN+1Z5D15NrV+sg1cKYri6lkJFRl2Jl0kqKIXBec=" />
</div>
<script type="text/javascript">
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('ctl00$ScriptManager', 'aspnetForm', [], [], [], 90, 'ctl00');
//]]>
</script>


<div id="NotPrincHome" style="text-align:center">
<h4><font font-family="arial" size="4pt">Ingrese Nombre de usuario y contraseña de Portal.</font></h4>
<table class=table align=center><tr><td>
<div style="width:200px;">


<script type="text/javascript">
$(document).ready(function () {
if ($("#ctl00_cphDetalle_ctrlLogin_txtUserName").val() != "Usuario")
$("#ctl00_cphDetalle_ctrlLogin_txtUserPassword").focus();
else
$("#ctl00_cphDetalle_ctrlLogin_txtUserName").focus();
});
function txtUserName_OnFocusIn(src) {
if (src != null && src.value == "Usuario")
src.value = "";
else
src.select();

}
function txtUserName_OnFocusOut(src) {
if (src != null && PJJS.Library.Commons.trim(src.value) == "")
src.value = "Usuario";
}

</script>
<table style="width:90%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td align="left" valign="top" class="txtcajalogueo">
Usuario: <input name="ctl00$cphDetalle$ctrlLogin$txtUserName" type="text" value="Usuario" id="ctl00_cphDetalle_ctrlLogin_txtUserName" class="cajalogueo" onFocusIn="return txtUserName_OnFocusIn(this)" onFocusOut="txtUserName_OnFocusOut(this)" />

</td>
<td>
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top" class="txtcajalogueo">
Contraseña: <input name="ctl00$cphDetalle$ctrlLogin$txtUserPassword" type="password" id="ctl00_cphDetalle_ctrlLogin_txtUserPassword" class="cajalogueo" />
</td>
<td align="left" valign="top">

</td>
</tr>
<tr>
<td>
<input type="image" name="ctl00$cphDetalle$ctrlLogin$btnLogIn" id="ctl00_cphDetalle_ctrlLogin_btnLogIn" src="../imgs/btn_ingresar.png" /></td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>

<span id="ctl00_cphDetalle_ctrlLogin_lblError" class="ErrorMessage"></span>
</td>
<td>
&nbsp;
</td>
</tr>
<tr>
<td>
<script type="text/javascript">
$(document).ready(function () {
$("#lnkForgotPWD").click(function () {
var str = "Portal/ForgotPassword.aspx";
$.webDialog.show({
height:350,
width:350,
buttons:{
"Cerrar":function(src, evt, dialogContainer){
$.webDialog.close(dialogContainer.attr("webDialogId"));
}
},
content: str,
type: "url",
onCloseFunction: function () { }
});
})
});
</script>
<a href="#" id="lnkForgotPWD" class="linkGris" >Olvid&oacute; su Contrase&ntilde;a?</a>
</td>
<td>
&nbsp;
</td>
</tr>
</table>
</div>
</td></tr></table>
</div>

</form>
</body>
</html>

AHORA EL SCRIPT que yo hice:

#include <IE.au3>

Opt("WinTitleMatchMode", 2)
$oIE = _IECreate ("https://www.justiciacordoba.gob.ar/marcopolo/_CuentasJudiciales/CuentasJudicialesAlta.aspx")
_IELoadWait ($oIE)


$o_form = _IEFormGetObjByName ($oIE, "aspnetForm")
$o_login = _IEFormElementGetObjByName ($o_form, "ctl00_cphDetalle_ctrlLogin_txtUserName")
$o_password = _IEFormElementGetObjByName ($o_form, "ctl00_cphDetalle_ctrlLogin_txtUserPassword")
$o_signin = _IEFormElementGetObjByName ($o_form, "ctl00_cphDetalle_ctrlLogin_btnLogIn")

$username = "xx"
$password = "xxxx"

_IEFormElementCheckBoxSelect ( $o_form, "remMe", "", 0)
_IEFormElementSetValue ($o_login, $username)
_IEFormElementSetValue ($o_password, $password)
_IEAction ($o_signin, "visible")
_IEAction ($o_signin, "focus")
_IEAction ($o_signin, "click")
_IELinkClickByText($oIE, "./Login.aspx?ReturnUrl=%2fmarcopolo%2fmenu%2findex.aspx")

;WinSetState ( "Internet", "", @SW_MINIMIZE )
darioreg
 
Mensajes: 1
Registrado: 12 Oct 2016, 20:36

Re: Ayuda soy nuevo en esto

Notapor Dany » 14 Oct 2016, 02:47

Hola. solo tienes que obtener el objeto Ingresar usando el ID.

Código: Seleccionar todo
Local $oIngresar=_IEGetObjById($oIE,"ctl00_cphDetalle_ctrlLogin_btnLogIn")
If IsObj($oIngresar) Then
   _IEAction($oIngresar,"click")
EndIf


Saludos :smt027
    ............................................Imagen
    ......................................Imagen
Avatar de Usuario
Dany
Profesional del Autoit
 
Mensajes: 643
Registrado: 28 Mar 2012, 22:49


Volver a esScripts - Programas - Abre tus creaciones maravillosas

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 2 invitados

cron