Jump to content

Code for automation of web form


Recommended Posts

I have a excel containing name and number of people. I need to register them on a website. 

The excel format is I have name in cell a1 and number in cell b1.

I just need to fill in these 2 details and click on submit. I have around 4000 rows to fill in to the web form.

Please help me with the code.

Link to comment
Share on other sites

  • Moderators

@PuneetTewani we operate on the "teach a man to fish" motto rather than you putting in a request and someone barfing up code for you. So what have you tried on your own already? The help file has some very good examples on interacting with Excel, I would suggest this as a starting place. Once you have tried this out on your own, if you run into trouble, post your code here and we would be happy to help :)

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

@JLogan3o13 I have tried my hands onto it, but struck somewhere in middle. The code is as follows:

#include <IE.au3>
#include <Excel.au3>

Call("signin")
Func signin()
    Global $oIE= _IECreate ("xyz.com")

    Local $username = _IEGetObjByName($oIE,"username")
    Local $password = _IEGetObjByName($oIE,"password")
    Local $button = _IEGetObjById($oIE,"loginBTN")

    _IEFormElementSetValue ($username, "979928")
    _IEFormElementSetValue    ($password, "PUNIT")
    _IEAction($button,"click")


EndFunc

MouseClick($mouse_click_left)
MouseClick($mouse_click_left,396,181)

Local $oExcel_1 = _excel_bookopen()
Local $sworkbook = "C:\punit.xlsx"
Local $oWorkbook = _excel_bookopen($oExcel_1,$sWorkbook)

WinActiavte($oWorkbook)

Local $_read = _excel_RangeRead($oWorkbook, "Sheet1","A1")

Local $mobileno = _IEGetObjByName($oIE,"mobile") // as read from excel
Local $message = _IEGetObjByName($oIE,"message") // as read from excel

 

I haven't been able to use for loop to read excel sheet. I just managed to read a cell.

The mobile numbers are in column A and message in Column B. Moreover, I need help in filling the data read from excel to tags mobileno and message.

 

Thanks 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...