|
From: Steve N. <Ste...@cl...> - 2006-10-20 07:01:42
|
We use a sbk file to do this job. (I'm assuming this field is the type that
will pop up a windows file
In the script we have this function
/**
*Steve N:
* This function allow you to enter a file name into file field.
* This type of field is usually identified by having a 'browse' button
* attatched to it.
* For this file to work you need a file named
* c:\testtools\EnterFileName.sbk.
*
* @param fname (string) The full file name and location.
* Remember \\\\ in the path.
* @param id (string) This is the HTML id of the field you wish
* to enter the information into.
*
* @returns This returns nothing, it either passes or fails.
*/
function enterFileField(fname,ID)
{
var optionsArray = [fname,ID];
var options = optionsArray.join(", ");
traceEnterFunction("enterFileField", options);
var cmdShell = new ActiveXObject("WScript.Shell");
cmdShell.Run("c:\\testtools\\EnterFileName.sbk " + fname, 0, false);
_.clickObjById(ID);
traceLeaveFunction("enterFileField");
}
The sbk file is:
//
// This script is called by asynchroneously
// to enter a file name to the upload-file window.
//
var fpath = " " + WScript.Arguments(1);
var popupWin = this.waitForWindow("Choose file", 30000);
this.findWindow(popupWin, "Edit").sendText(fpath);
this.findWinButton(popupWin, "&Open").click();
I hope this helps
Stephen Newton.
Senior Test Engineer
CLEARSWIFT
The MIMEsweeper Company
MSN: SW_...@Ho...
Web: www.clearswift.com
-----Original Message-----
From: ieu...@li...
[mailto:ieu...@li...] On Behalf Of
ieu...@li...
Sent: 19 October 2006 21:46
To: ieu...@li...
Subject: Ieunit-general Digest, Vol 4, Issue 1
Send Ieunit-general mailing list submissions to
ieu...@li...
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/ieunit-general
or, via email, send a message with subject or body 'help' to
ieu...@li...
You can reach the person managing the list at
ieu...@li...
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Ieunit-general digest..."
Today's Topics:
1. Field type file problem (wj...@co...)
----------------------------------------------------------------------
Message: 1
Date: Thu, 19 Oct 2006 15:34:44 +0000
From: wj...@co...
Subject: [Ieunit-general] Field type file problem
To: ieu...@li...
Message-ID:
<101920061534.16890.45379B140005D9A2000041FA2207300033CE020E979D0699@comcast
.net>
Content-Type: text/plain; charset="us-ascii"
I am attempting to automate an application. One of the issues that I am
running into is, on the form I am working with is a field of input type
file. I got ieunit to recognize/find the field by changing the leDhtml.js
file and adding e.type=="file" to the findfield function. The difficulty I
am having is using setfield to put data into this field. When I issue the
setfield command against that field nothing happens and the test case
continues. Anyone have any idea about the input type file and what you need
to do to get the setfield working against it?
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://sourceforge.net/mailarchive/forum.php?forum=ieunit-general/attachment
s/20061019/a07aaac2/attachment.html
------------------------------
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
------------------------------
_______________________________________________
Ieunit-general mailing list
Ieu...@li...
https://lists.sourceforge.net/lists/listinfo/ieunit-general
End of Ieunit-general Digest, Vol 4, Issue 1
********************************************
|