All,
I am in need of writing
java application which logs into website.
The website which i want to log in.
i have attached the login screenshot , login html , login javascript and the javacode which i am using.
when i execute the java code , it gives me 200 http response but does not log into the website.
important thing to note is the 'password' in the login page is as part of the javascript and not part of the login form. I have hardcoded to generate this attribute to make it available as part of the post request.
i have also tried loggin using chrome poster ....When i try to post the request via chrome poster to the action url specified in the login form of login.html , i am not able to login to the site.
can anyone guide me as to what am i missing ?
how to set password filed which is available in javascript , is my hard coding in login.java correct?
Is it feasible to automate this login process using java.
any suggestions are greatly welcomed....hoping to have some guidance.
Please let me know if i need to provide further details.
login.java code snippet
------------------------------
Javascript snippet
-------------------
login or index html
---------------------
<HTML><HEAD><TITLE>Citrix Access Gateway</TITLE>
<link rel="SHORTCUT ICON" href="/vpn/images/AccessGateway.ico" type="image/vnd.microsoft.icon">
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META content=noindex,nofollow,noarchive name=robots>
<LINK href="/vpn/images/caxtonstyle.css" type=text/css rel=STYLESHEET>
<script type="text/javascript" src="/vpn/resources.js"></script>
<script type="text/javascript" language="javascript">
var Resources = new ResourceManager("resources/{lang}", "logon");
</script>
<style type="text/css">
body
{
visibility: hidden;
}
</style>
<script language="javascript" type="text/javascript" src="/vpn/nsshare.js"></script>
<script language="JavaScript" type="text/javascript" src="login.js"></script>
<SCRIPT language=JavaScript>
// frame-busting script
setTimeout ("changePage()", 0);
function changePage()
{
if (self.parent != self)
top.location=document.location;
}
function setFocus(obj)
{
if (obj != null) {
obj.focus();
}
}
//-->
</SCRIPT>
<META content="MSHTML 6.00.2900.2802" name=GENERATOR></HEAD>
<BODY id=bodyTag onload="ns_fillName();">
<!-- Copyright 2001-2005 Citrix Systems, Inc. All Rights Reserved -->
<NOSCRIPT>
<BR><BR>
<table style="WIDTH: 100%">
<tr>
<td align="center">
<table class="CTXMSAM_LogonFont">
<tr id="errorMessageRow">
<td class="glowBoxLeft"> </td>
<td class="loginTableMidWidth">
<div id="feedbackArea">
<div id="feedbackStyle" class="feedbackStyleError">
<span id="errorMessageLabel" class="messageStyle">
JavaScript is either disabled in or not supported by the Web browser.
To continue logon, use a Web browser that supports JavaScript or enable JavaScript in your current browser.
</span>
</div>
</div>
</td>
<td class="glowBoxRight"> </td>
</tr>
</table>
</td>
</tr>
</table>
<table style="display:none">
</NOSCRIPT>
<!-- Header -->
<script language="javascript" type="text/javascript">
CreateMainTable();
AddHeaderAndBar();
</script>
<!-- Logon box -->
<tr class="mainPane" >
<td class="carbonBoxBottom" valign="bottom">
<script language="javascript" type="text/javascript">
documentWriteGlowBoxUpper();
</script>
<FORM method="post" action="/cgi/login" name="vpnForm" autocomplete="off" style="margin:0"
onsubmit="clean_name_cookie();">
<table cellspacing="4" cellpadding="0" border="0" width=100%>
<tr>
<td class="CTX_ContentTitleHeader">
<div id="ctl08_loginAgentCdaHeaderText" style="padding-left:15px"><span id="Welcome"></span></div>
</td>
</tr>
<tr>
<td class="CTXMSAM_LogonFont">
<div id="ctl08_loginAgentCdaHeaderText2" style="padding-left:15px"></div>
</td>
</tr>
<tr border=10>
<td class="CTXMSAM_LogonFont" valign="top">
<script language="javascript" type="text/javascript">
documentWriteActionPane();
</script>
<table width=70% id="ctl08_inputTable" class="CTXMSAM_LogonFont" cellspacing="0" cellpadding="4" border="0" style="border-width:0px;border-collapse:collapse;">
<tr><td colspan=3></td></tr>
<tr>
<td align="right" style="padding-right:10px;white-space:nowrap;"><span id="User_name" class="CTXMSAM_LogonFont"></span></td>
<td colspan=2 style="padding-right:8px;"><input id="Enter user name" class="CTXMSAM_ContentFont" style="font-size: 8pt" type="text" title="" name="login" size="30" maxlength="127" onFocus="loginFieldCheck()"style="width:100%;" /></td>
</tr>
<SCRIPT language=JavaScript>ns_showpwd();</SCRIPT>
<tr>
<!-- Disclaimer customization - Add a name to the LogonButton in order to be referenced later -->
<td></td><td></td><td align="right"><span style="display:none"><img src="/vpn/images/LoginButtonRolloverGlow.gif"/></span><input type="submit" id="Log_On" value="" class="CTX_CaxtonButton" onclick="ns_check();" onmouseover="this.className='CTX_CaxtonButton_Hover';" onmouseout="this.className='CTX_CaxtonButton';" name="LogonButton" disabled="true"/></td>
</tr>
<!-- Disclaimer customization -->
<tr><td colspan=3 align="center" style="font-size: 12pt" type="text" ><input type="checkbox" name="chk1_button" onClick="enableLogonButton(this);"/>  I Accept</td></tr>
<tr><td colspan=3 align="left" style="font-size: 8pt" type="text" >  By checking <b>"I Accept"</b> above you agree to the following terms and conditions:</td></tr>
<tr><td colspan=3 align="left" style="font-size: 8pt" type="text" >  Use of this system evidences an express consent to such monitoring and agreement that if such monitoring reveals evidence of possible abuse or criminal activity, system personnel may provide the results of such monitoring to appropriate officials.</td></tr>
</table>
<!-- End of Disclaimer customization-->
</div>
</td>
</tr>
</table>
</FORM>
<script language="javascript" type="text/javascript">
documentWriteGlowBoxLower();
</script>
</td>
</tr>
<!-- Error message box -->
<tr>
<td align="center">
<table class="CTXMSAM_LogonFont">
<tr id="errorMessageRow">
<td class="glowBoxLeft"> </td>
<td class="loginTableMidWidth">
<script language='javascript'>ns_disperrmsg();</script>
</td>
<td class="glowBoxRight"> </td>
</tr>
</table>
</td>
</tr>
<!-- Footer -->
<script language="javascript" type="text/javascript">
AddFooter();
</script>
</table>
<DIV id=scriptArea></DIV>
<script type="text/javascript" language="javascript">
Resources.Load();
</script>
</BODY>
</HTML>