copying the file in local hard drive to the text field in the web using WATIR

M

michael

In my previous inquiry, I have received the below suggestion; I was
inquiring how I can copy a file in my hard drive to the text field in
the web.

Yes, below code works!!! but each file I need to upload is quite
lengthy, and I have many hundreds of them.

When I run the code below, WATIR is reading the file in my hard drive a
character by character into the text field in the web; it simply takes
too long.

Is there anyway I can copy the file in my hard drive in its entirety
all at once, and paste it to the text field in the web at once?? That
way I do not have to wait till the code reads a character by
character.. and the job will be done much faster..

any suggestion or help will be deeply appreciated.

thanks.

m.
======================================================================

Well, what you're doing is just taking the contents of the variable
$Path and setting it to the text field. You'll actually need to open
and read the file. For example...

ie.text_field:)name, "html_text").set(File.new($Path).read)


That should do it.


M.T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top