Kash Posted March 27, 2009 Share Posted March 27, 2009 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. Link to comment Share on other sites More sharing options...
BrettF Posted March 27, 2009 Share Posted March 27, 2009 Look at the _IE* Functions in the helpfile, under the UDF section. Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Kash Posted March 27, 2009 Author Share Posted March 27, 2009 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? Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted March 27, 2009 Share Posted March 27, 2009 -------------------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() .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Kash Posted March 27, 2009 Author Share Posted March 27, 2009 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? Link to comment Share on other sites More sharing options...
Authenticity Posted March 27, 2009 Share Posted March 27, 2009 (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 March 27, 2009 by Authenticity Link to comment Share on other sites More sharing options...
Kash Posted March 27, 2009 Author Share Posted March 27, 2009 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? Link to comment Share on other sites More sharing options...
Authenticity Posted March 27, 2009 Share Posted March 27, 2009 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? Link to comment Share on other sites More sharing options...
Kash Posted March 27, 2009 Author Share Posted March 27, 2009 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? Link to comment Share on other sites More sharing options...
DaleHohm Posted March 28, 2009 Share Posted March 28, 2009 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now