Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
inet
active_desktop
active_scrptng
asp.components
asp.db
asp.general
comctl32
comp.packaging
components.dev
dbweb
dhtml_editing
docobjects
html_authoring
html_objmodel
iis
iis.ftp
iis.security
iis.smtp_nntp
indexserver
misc
mshtml_hosting
scripting.jscript
scripting.vbscript
sdk_setup
shell_objmodel
urlmonikers
webbrowser_ctl
wininet
  
 
date: 20 Dec 2005 15:51:32 -0800,    group: microsoft.public.inetsdk.programming.scripting.jscript        back       


Is it possible to script text into a fileUpload field?   
Using a javascript-driven, automated web-app test tool, is the
following possible using javascript?

-   the test tool runs via an hta to test a web application.
-   trying to completely automate the testing of the app, w/no manual
user-interaction,
    whatsoever
-   one of the web pages contains a file upload field
-   would like to enter a filename into the file upload field's "text"
box using script(s) (w/o clicking
    the "Browse" button).  if direct editing of the file upload "text"
box is not allowed, can
    javascript select a file from the file selection dialog that
appears after clicking the "Browse"
    button?

thanks so much in advance.
date: 20 Dec 2005 15:51:32 -0800   author:   tluckett

Re: Is it possible to script text into a fileUpload field?   
tluckett wrote:
> Using a javascript-driven, automated web-app test tool, is the
> following possible using javascript?
>
> -   the test tool runs via an hta to test a web application.
> -   trying to completely automate the testing of the app, w/no manual
> user-interaction,
>    whatsoever
> -   one of the web pages contains a file upload field
> -   would like to enter a filename into the file upload field's "text"
> box using script(s) (w/o clicking
>    the "Browse" button).  if direct editing of the file upload "text"
> box is not allowed, can
>    javascript select a file from the file selection dialog that
> appears after clicking the "Browse"
>    button?
>
> thanks so much in advance.


You cannot manipulate the input type=file element via the browser DOM for 
security reasons and the enormous exposure for abuse.  It is intended only 
for actual user interaction. The best you could do would be experimenting 
with a third party component like AutoItX.


-- 
Michael Harris
Microsoft MVP Scripting
date: Tue, 20 Dec 2005 19:47:10 -0800   author:   Michael Harris \(MVP\) mikhar at mvps dot org

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us