6

I have little business problem, I need to make a script to fill (not send) out browser forms(only simple textfields, checkboxes and drop downboxes).

I need to launch multiple windows with the same form with different data to speed up form filling

  1. What kind of scripting/programming do I need to use to fulfill these needs(Batch, JS .. ) ?
  2. I have knowledge only of java, and basic html,c,c++ ... so if I can get basic tutorials I would be grateful indeed.

I have bits of ideas of how this is possible - through IDs of various field on the page which I can access to edit their values, so I just need language specific tutorials/suggestions.

Batch would be preferable if possible, because i need to execute the script through a java swing program.

P.S : If this is of any relevance, only browser acceptable is IE

Mukul Goel
  • 8,387
  • 6
  • 37
  • 77
Arjun
  • 67
  • 1
  • 1
  • 4

2 Answers2

2

dont think its possible through Batch,

I think easiest would be javaScript for this task. (chill js is pretty easy)

You can write a simple javaScript to fill in form You should find how to fill form through javaScript helpful

Then you can use ScriptEngineManager to execute javaScript from your java code.

This tutorial should be helpful :execute javascript from java

Community
  • 1
  • 1
Mukul Goel
  • 8,387
  • 6
  • 37
  • 77
  • some more questions arise : 1. Where do I code this in, notepad? And save it as what extension?--- 2. The saved file, will I need to compile it using a compiler(or JS does not need any...I really don't have a clue about JS) ?--- 2. How will I be able to launch multiple windows with the same URL using JS ? – Arjun Nov 20 '12 at 07:30
  • To kickstart your javaScript skills read [javaScript tutorials](http://www.w3schools.com/js/default.asp) , 1) you could write it in notepad too. 2) javaScripts are saved by `.js` extension. – Mukul Goel Nov 20 '12 at 07:43
  • @Arjun you can launch same urls in multiple windows/tabs. [ref](http://www.w3schools.com/jsref/met_win_open.asp) . I aint building the blocks for you. Build up your logic, what you want to do, break the problem and search, read tutorials. everything is out there. – Mukul Goel Nov 20 '12 at 07:55
  • Thanks, I'm sure I'll do the rest myself – Arjun Nov 20 '12 at 08:09
  • Sorry, to bug you again ... but the most important requirement was to use this script on another website, is that even possible with JS? Because I was able to do something of that sort with VBScript. I was able to edit forms of a sample webpage I made. And just to clarify, I don't have any malicious intentions, only to speed up form filling – Arjun Nov 22 '12 at 14:21
  • @Arjun : I dont get you what you mean. Also if there is some question a new one. you should post it in a new thread to get everyone attention and not just mine. P.S : I dont care if you have any malicious intentions too. – Mukul Goel Nov 23 '12 at 08:05
0

You can't fill HTML-fields with a Batch-File. The easiest way is to use Javascript an Greasemonkey in Mozilla Firefox. You can find Tutorials here.

An other way to send data to an WebServer is to use in C/C++/Java Sockets and the HTML-Protocol.