Bonjour,
je n'arrive pas à faire l'opération suivante :
considérons une page web avec :
-un label marqué login et un edit pour le taper
-un label marqué password et un edit pour le taper
-et un bouton marqué authenticate

je voudrais que mon logiciel "simule" le remplissage des champs login et password puis le clic sur le bouton, le tout SANS UTILISER DE WEB BROWSER, le but étant que ça aille plus vite que de le faire soit même.

Voila le code source de la page web, merci pour votre aide.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
 
<html>
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="Cache-Control" content="no-cache">
<link rel="SHORTCUT ICON" href="/favicon.ico">
 
<title>WebAuth</title>
<script language="JavaScript"> 
 
if (window.opener) {
	window.opener.location.href = document.location.href;
	self.close();
}	
 
if (top.location != document.location) top.location.href = document.location.href;
 
var is_DOM = (document.getElementById)? true : false;
var is_NS4 = (document.layers && !is_DOM)? true : false;
 
var sAgent = navigator.userAgent;
var bIsIE = (sAgent.indexOf("MSIE") > -1)? true : false;
var bIsNS = (is_NS4 || (sAgent.indexOf("Netscape") > -1))? true : false;
var bIsMoz5 = ((sAgent.indexOf("Mozilla/5") > -1) && !bIsIE)? true : false;
 
if (is_NS4 || bIsMoz5)	{
    document.writeln("<style type=\"text/css\">");
    document.writeln(".operadummy {}");
    document.writeln("</style>");
}else if (is_DOM) {
    document.writeln("<style type=\"text/css\">");
    document.writeln("body {");
    document.writeln("	font-family: \"Verdana\", \"Arial\", \"Helvetica\", \"sans-serif\";");
    document.writeln("	background-color : #FFFFFF;");
    document.writeln("	background-repeat: no-repeat;");
	document.writeln("	background-position: center;");
    document.writeln("}");
    document.writeln(".spacer {}");
    document.writeln(".operadummy {}");
    document.writeln("</style>");
}
 
function stripSpace(x)
{
	return x.replace(/^\W+/,"");
}
 
function toggleDisplay(style2)
{
	if (style2.display == "block") {
		style2.display = "none";
		style2.visibility = "hidden";
	} else {
		style2.display = "block";
		style2.visibility = "";
	}
}
 
function toggleLayer(whichLayer)
{
	if (document.getElementById)
	{
		var style2 = document.getElementById(whichLayer).style;
		toggleDisplay(style2);
	}
	else if (document.all)
	{
		var style2 = document.all[whichLayer].style;
		toggleDisplay(style2);
	}
	else if (document.layers)
	{
		var style2 = document.layers[whichLayer].style;
		toggleDisplay(style2);
	}
}
 
function acceptCheckIt(ok)
{
	if (!eval(ok)) {
        top.location.href = "/index.html";
		return;
	}
 
	var fm = document.forms[0];
	var d = new Date();
	name = fm.admin_id.value; 
	pass = fm.admin_pw.value; 
	if (   (name.length > 0 && name.length < 32) 
		&& (pass.length > 0 && pass.length < 32)
	   ) { 
			fm.submit();
			return true;
	 }
	 return false;
}
 
function checkIt() 
{
 
		 acceptCheckIt(true);
 
}  
 
function cancelIt() 
{
   return false;
}		
 
var margin_top = 0;   
if (document.layers || bIsMoz5) {
	margin_top = (window.innerHeight - 330) / 2;
	if (margin_top < 0) margin_top = 0;
 
} 
 
</script> 
</head>
 
<body bgcolor="White" link="Black">
 
<div id="div1" style="display:block">
<FORM method="POST" name="webauthlogin" ACTION="/web_auth/index.html">   
  	<INPUT type="hidden" name="edit_cookies" VALUE="">
<script language="javascript"> 
	if (bIsMoz5 && (margin_top > 0)) {
		document.writeln("<table width='100%' border='0' cellspacing='0' cellpadding='0' style='margin-top: " + margin_top + "px;'>");
	} else {
		document.writeln("<table width='100%' height='100%' border='0' cellspacing='0' cellpadding='0'>");
	}
</script>
<td align="center" scope="row">
 
	<table border='0' cellpadding='0' cellspacing='0'>
	<tr align="center">
		<td width='100%' align='center'>
 		<table bgcolor='' background='' border='0'>
		<tr align="center">
			<th align="right" style="font-size:10pt;" nowrap="1">User Name: </th>
			<td align="left" style="font-size:10pt;"><INPUT type=text name="admin_id" tabindex="1" SIZE="21" MAXLENGTH="31" VALUE="">
			</td>
		</tr>
 
		<tr align="center">
			<th align="right" style="font-size:10pt;">Password: </th>
			<td align="left" style="font-size:10pt;"><INPUT type="password" name="admin_pw" tabindex="2" SIZE="21" MAXLENGTH="31" VALUE=""> 
			</td>
		</tr>
		<tr align="center">
			<td>&nbsp;</td>
			<td align="left">
			<INPUT type="button" value=" Authenticate " onClick="checkIt();" tabindex=\ "4\">
			</td>
		</tr>
 
		</table>
 
	</td>
	</tr>
 
	</table>
 
</td>
</tr>
</table>
</FORM>
</div>
 
<div id="div2" style="display:none">
<pre>
 
</pre>
<bar />
<center>
<FORM name="additional">
	<INPUT type="button" value="Accept" onclick="acceptCheckIt(true);">
	&nbsp;
	<INPUT type="button" value="Decline" onclick="acceptCheckIt(false);">
</FORM>
 
</center>
</div>
 
</body>
</html>