For IE6 and IE7 the upload control may be automated by setting the focus to "Internet Explorer_Server" window and generating Win32 keyboard events. For IE8, the upload control is read-only, the user can only set a value by pressing "Browse" button and choosing a file.
With Twebst Automation Studio, automating HTML File Upload Control can't be easier. Here's a short VBScript sample of doing it:
Option Explicit
Dim core
Dim browser
Set core = CreateObject("Twebst.Core")
Set browser = core.StartBrowser("http://www.2shared.com/")
Call browser.FindElement("input file", "id=upField").InputText("C:\somepath\photo1.jpg")
4 comments:
This tool is really helpful!!! Thanks.
But I face a trouble: If I choose 2 files, like this:
Call browser.FindElement("input file", "name=files[]").InputText("D:\dl\a.txt, D:\dl\b.txt")
When I run the macro, 1 error reported: fielpath invalid...
This tool is really helpful!!! Thanks.
But I face a trouble: If I choose 2 files, like this:
Call browser.FindElement("input file", "name=files[]").InputText("D:\dl\a.txt, D:\dl\b.txt")
When I run the macro, 1 error reported: fielpath invalid...
This tool is really helpful!!! Thanks.
But I face a trouble: If I choose 2 files, like this:
Call browser.FindElement("input file", "name=files[]").InputText("D:\dl\a.txt, D:\dl\b.txt")
When I run the macro, 1 error reported: fielpath invalid...
If I choose 2 files like this:
Call browser.FindElement("input file", "name=files[]").InputText("D:\dl\a.txt, D:\dl\b.txt")
When I run this micro, error report: filepath invalid...
It means multifile selection does not support?
Post a Comment