Hi Marcus,
It did not work ..
Basically what I want to to is to make sure that the data that I assign to the field using FormFill is acctually accepted by the page.
The biggest problem (as I se it )in automating the differnt apps (including IE) is timming. And it is very important to have routines that check and double check that the apps have recieved the data. So what I'm trying to write is a generic FormFill SRT that can assign data to a field and verify the the field has actualley recieved the data.
If you have an exmaple or some add-on library that I can purchace then
I'm all ears
Here is my macro code:
Code: Select all
LibFunc>hIE,CreateIE,IE[0],0
LibFunc>hIE,Navigate,r,%IE[0]%,http://labka.serv.hosp.dk:7003/LabkaII/login.jsp
LibFunc>hIE,WaitIE,r,%IE[0]%
// Afdeling
LibFunc>hIE,FormFill,r,%IE[0]%,{""},{"loginform"},{"wardCode"},%[<Login_Afdeling>]%,0
LibFunc>hIE,WaitIE,r,%IE[0]%
// Klik på "Vis" til at finde afdelingen
LibFunc>hIE,ClickTag,r,%IE[0]%,{""},{"loginform"},BUTTON,ID,searchBtn
Wait>1
LibFunc>hIE,ContainsText,exists,%IE[0]%,{""},Afdeling findes ikke
If>exists=1
GoSub>DMExit,Error:Fejl i afdelingsoplysninger:%[<Login_Afdeling>]%
EndIf
// Brugernavn & kodeord
LibFunc>hIE,FormFill,r,%IE[0]%,{""},{"loginform"},{"username"},%[<Login_BrugerNavn>]%,0
LibFunc>hIE,FormFill,r,%IE[0]%,{""},{"loginform"},{"password"},%[<Login_kodeord>]%,0
**breakpoint**
Let>mydata_SIZE=4098
LibFunc>hIE,ExtractTagByName,r,IE[0],,INPUT,username,0,mydata
MidStr>r_6,1,r,mydata
And here is the source form the web page:
Code: Select all
<DOCTYPE>
<html>
<head>
<script>
//code to prevent opening login page in a modal dialog.
if (window.dialogArguments != null) {
window.returnValue = "relogon";
window.close();
}
//code to prevent opening login page in a frame.
if (top.location != self.location) {
top.location = self.location;
}
</script>
<title>LABKA II indlogning</title>
<meta>
<meta>
<link>
</head>
<body>
<script></script>
<script></script>
<script></script>
<script></script>
<script></script>
<script>
var shortcutManager = new ShortcutManager();
shortcutManager.addShortcut("alt+l","document.all('loginbtn').click();", "");
shortcutManager.addShortcut("alt+i","document.all('searchBtn').click();", "");
shortcutManager.addShortcut("enter", "doDefaultAction('loginbtn')", "");
document.onkeydown = shortcutManager.keyEventListener;
window.returnValue = "relogon";
var _WARD_NAME = "Geriatrisk Sengeafsnit, M2";
var _WARD_CODE = "m2(fh)";
function onLoad(){
//description: Method is called during of onLoad event handling.
// It is used to perform client side initialization.
setListDisableControls();
attachTabOrderEvent();
contentContainer.style.display = 'block';
checkCodeAndName(trim(loginform.wardCode.value), trim(loginform.wardName.value), _WARD_CODE, _WARD_NAME);
if (document.all("wardName").value == "") {
document.all("wardCode").focus();
document.all("username").disabled = true;
document.all("password").disabled = true;
} else {
document.all("username").focus();
}
}
window.navigator.loggedProperty = LOGGED_PROP_VALUE;
document.cookie = "PATH=/";
</script>
<noscript>
<h1>Error screen:</h1><br>
<b>Please turn on JavaScript support.</b>
</noscript>
<script></script>
<div>
<h1>LABKA II indlogning</h1>
<form>
<table><tr><td>
<table>
<tr>
<td><a>Hjælp</a>
<script>
function showHelp() {
var md=showModalDialog('loginhelp.html','','status=0,title=0,resizable=no,scrollbars=no,dialogWidth=300px,dialogHeight=100px');
}
window.onhelp = showHelp;
</script>
</td>
</tr>
<tr>
<td>Afdeling</td>
<td><input></td>
<td><button>V<SPAN>i</SPAN>s</button></td>
<td><input></td>
</tr>
<tr>
<td>Brugernavn</td>
<td><input>
</td>
</tr>
<tr>
<td>Password</td>
<td><input></td>
</tr>
<tr>
<td>
<button><SPAN>L</SPAN>og ind</button>
</td>
</tr>
</table>
</td></tr></table>
<input>
<input>
</form>
</div>
</body>
</html>