Sign in to follow this  
Followers 0
Kash

Automatic Data Input in IE Forms using AutoIT program

10 posts in this topic

Hello,

I have developed a program which inputs data automatically in IE browser forms(e.g. text boxes etc). The objective is to input data automatically and click on search/submit button to submit it. Before inputting data i have resized browser window by using WinMove("XXXX -", "", 0, 0, 1920, 1440). After that i used MouseClick to click on required text box to input data.

This works fine on my machine, however on some other machines with different sizes of monitor, mouse click is clicking incorrectly at different place therby failing automatic data input.

I have developed this under the assumption that after resizing window co-ordinates will match for all sizes of screens.

Below is sample code.

WinActivate("XXX")

WinMove("XXX", "", 0, 0, 1920, 1440)

Sleep(1000)

WinWaitActive ("XXX -","",3)

MouseClick("left",340,230,2,3)

Sleep(1000)

Send ("{DELETE 10}")

Sleep(500)

Send ($BillingAccountNo)

Send ("{ENTER}")

Is this related to co-ordinates of browser? Is there any way by which I can get co-ordinates of a text box using a IE lable or so?

Please Help.

Thank you.

Share this post


Link to post
Share on other sites



Look at the _IE* Functions in the helpfile, under the UDF section.

Cheers,

Brett

-------------------

Thank you for your help.

I have referred those functions. Most of them are for creating a new IE window and then manage its controls.

I am looking for something which will manage controls, get their co-ordinates for EXISTING IE windows.

Is there any way by which we can get controls of any IE browser based on its Title?

Share this post


Link to post
Share on other sites

-------------------

Thank you for your help.

I have referred those functions. Most of them are for creating a new IE window and then manage its controls.

I am looking for something which will manage controls, get their co-ordinates for EXISTING IE windows.

Is there any way by which we can get controls of any IE browser based on its Title?

Sounds like you need _IEAttach()

Share this post


Link to post
Share on other sites

Sounds like you need _IEAttach()

Thank you very much....I am able to attach required IE instance.

However I want to enter text in 3rd text box on IE window automatically...How can i do that?

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

If it's an <input> element, get it's ID or name using _IEGetObjById and use _IEFormElementSetValue to change it's content.

Edit: To get the ID or name you need to use DebugBar to see it's name or ID then pass this string to _IEGetObjById to get an object referencing this element to send to the _IEFormElementSetValue function.

Edited by Authenticity

Share this post


Link to post
Share on other sites

If it's an <input> element, get it's ID or name using _IEGetObjById and use _IEFormElementSetValue to change it's content.

Edit: To get the ID or name you need to use DebugBar to see it's name or ID then pass this string to _IEGetObjById to get an object referencing this element to send to the _IEFormElementSetValue function.

You are simply Great...It works thank you....

One more issue i am facing though....There two different frames in a web page. Left pane and main Pane.

It is not able to detect text box in left pane..I have tried both using _IEGetObjById and _IEGetObjByName.

Not sure why?

Share this post


Link to post
Share on other sites

I've never worked with frames using IE.au3 library so I don't know how to change value of element not within the main html source. Can you post the site url to work with a true meat?

Share this post


Link to post
Share on other sites

I've never worked with frames using IE.au3 library so I don't know how to change value of element not within the main html source. Can you post the site url to work with a true meat?

Sorry i did not understand your last question.....Can you elaborate?

Share this post


Link to post
Share on other sites

See _IEFrameGetObjByName()


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
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
Sign in to follow this  
Followers 0