Script for data upload

Getting started -basics for starting with WinTask

Script for data upload

Postby Walt on Mon Feb 17, 2014 8:09 am

Hi,
I am very interested in using WinTask to import data into a web site. For each user I need to import data in a Web form
Can you give me an example of reading data from Excel and looping for each user?
Walt
 
Posts: 13
Joined: Fri Dec 24, 2004 10:44 am

Re: Script for data upload

Postby TechSupport on Tue Feb 18, 2014 10:29 am

Hello,

I paste below a sample code. You need to create the Excel file in the same folder as the one where the script is saved. Put some usernames in the column A.
The loop stops when a A cell is empty.
Code: Select all
Dim user$(100)
fileexcel$="username.xlsx"

'Populate user$ array with all the user names which are in column A of the Excel file
ReadExcel(fileexcel$,"A1:A100",user$())
'So user$(0) contains A1 cell
'user$(1) contains A2 and so on

StartBrowser("IE","www.wintask.fr/demos/formulaire.htm",3)

i=0
repeat
UsePage("Formulaire")
   WriteHTML("INPUT TEXT[NAME= 'nom']", user$(i))
   ClickHTMLElement("INPUT RESET[VALUE= 'Effacer']")
   Pause 1
   i=i+1
until user$(i)=""

CloseBrowser()


Regards.
WinTask Techsupport
TechSupport
 
Posts: 805
Joined: Thu Nov 16, 2006 9:58 am


Return to Getting started

Who is online

Users browsing this forum: No registered users and 1 guest

cron