Welcome to WebmasterWorld Guest from 50.19.34.234

Forum Moderators: incrediBILL

Message Too Old, No Replies

upload all the files in a folder to a website one at a time

     

ZurLZum

6:42 am on Jan 3, 2013 (gmt 0)



I am trying to write a script using the selenium IDE
I want to upload all the files in a folder to a website one at a time
I am trying to set it up so i only have to run this script each time i have to upload a batch

/Users/me/Desktop/files
Has a bunch of files in it

Basically I need an array with each element in it referring to the absolute file path of each of the files contained in
/Users/me/Desktop/files
Then it opens the webpage and uploads the value of the next element in the array
Hits a submit button
Then repeats the process until all the elements/files have been handled

This is what i have so far
it dose it once using a specific file



<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://www.thesite.com" />
<title>New Test</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">New Test</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>/upload.php</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=file</td>
<td>/Users/me/Desktop/files/f1</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>css=input.btn</td>
<td></td>
</tr>

</tbody></table>
</body>
</html>



Im not sure if this is really what selenium was made for but it sounds like it could do what im looking for
I know a bit about programing mostly java but im out of my depth here, any help would be appreciated. Even other avenues to look into.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month