Kantu to automate filling 20 slightly different web forms, is it possible

csvsave
selenium-ide

#1

I have a tedious task of filling 20 or more directories for a business client.
There are about 20 fileds to fill
So far I think i could do this with csv file but id have to learn how
The extra problem is that the answer may be different for different sites.
e.g. quesion: what is your role? answer may be CEO in one site, but Principal on another.
e.g Business classification is a similar problem.

I need a column in my csv for each site with the correct version of the answer, but I cant see how that would be done.
Is it maybe possible to have 20 csv files one per site and then run all 20 macros as a batch?

Thanks

Ed


#2

Yes it’s possible

I use the solution to use 1 column with all data and i split it but you can use different csv without problem.

If you use browser portable you can run unlimited macro in different browser (portable).


#3

Thanks, sounds interesting.
Does it need knowledge of Java?
I am a programmer, but not Java. Syntax wouldn’t be an issue but, I wouldn’t be able to find and import the right libraries etc

Ed


#4

Hi

To do this need only to know selenium ide commands

https://a9t9.com/kantu/docs/selenium-ide

And some functions of Kantu

https://a9t9.com/kantu/docs

You don’t need to know java, I occasionally use javascript for some functions.


#5

Thanks this has been hugely helpful.

some comments maybe a few more hints are possible. Much appreciated in any case


ok so I:
(very rough pseudocode) the labels reminds me of vba so I am copying that error handling regime a little

!ErrorIgnore true
COMMANDOK1

csvread mycsvfile

start loop over the scv
get a line

find the control (username0) {col1} and type (textbox) {col2}
depending on type I then
sendkeys value (${col3}

//or submit
sometimes after a submit I may wait for form 1 to submit and a new form to apprear
check that x exists on the page then
if verifyElementPresent(some element name)===true {
continue submitting form 2
or wait
after waiting 30 seconds give up and sned an email
}
//or dropdown

selectByvalue ({col3} ) or is it select name= ({col3} )

etc
Gotoif {!statusOK} //jump to label at start and do the next one Gotoif !{!statusOK} //got to error handler

//else store the error message
COMMANDERROR1
//csvSave ??? cant make asny sense of the instructions for csvSave.
store “error” !csvline
store “the problem” !csvline
store “the page title” !csvline
store !URL !csvline
csvSave

goto COMMANDOK1

Have I missed anything important?
The keys to success for me are:

  1. Fill in everything on each form
  2. Report any errors including the url of the form and what field caused a problem plus any error messages?
  3. Not stop and have a tantrum when an error occurs, but go the next section or next url(form)
    4 Put all my macros in a test suite and execute them all in a batch unattended (more or less) but know what I need to give personal attention to because it failed etc

E.G. If I cant make a match on a drop down, I need to know that and log an error so it can be manually fixed afterwards