anand Posted February 27, 2009 Share Posted February 27, 2009 Hi, is any auto it function available to set the focus to a specific control in a web application? Regards! Anantharajan. Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 27, 2009 Share Posted February 27, 2009 (edited) Hi,is any auto it function available to set the focus to a specific control in a web application?Regards!Anantharajan.Don't let the dog eat your help file!ControlFocus() Edit: Oops, a little to quick with the snarky reply (web page, not GUI), but it's still in your help file: _IEAction() with "focus". Edited February 27, 2009 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
anand Posted March 11, 2009 Author Share Posted March 11, 2009 Hi, I want to give focus during run time. For example, one commandbutton is present in a web page. What i want to do is change focus to that control(command button) during runtime and this is not for the window which is created by Auto IT. Think if you have more than one IE opened then you don't have unique properties of Text, ID,class name etc.. So we cannot use this function for give focus. Since we do not get unique values. Thanks, Anand Link to comment Share on other sites More sharing options...
anand Posted March 11, 2009 Author Share Posted March 11, 2009 You will get different control id and text every time when you run the script. So we don't have any fixed control id or text for our script. We can not use this method in this situation. If you know how to solve this problem then reply immediately plz. Link to comment Share on other sites More sharing options...
huskies Posted March 11, 2009 Share Posted March 11, 2009 i have a similar problem, i'm trying to press a website button automatically but the button does not have an id or name, so i can't use IEgetobjbyid or IEgetobjbyname Welcome to my Tombola! Great prizes to be won, just put your hand (or paw) in, pick up a tombola ticket, and see what prize you win. Anything ending with a <b>0, 2 or 5</b> is a winner! <p> You can play the Tombola <i>once per day</i>. Please do not create multiple accounts in order to play the tombola, <b>we will freeze people we see doing this because its cheating!</b> <p> <center> <form action='tombola2.phtml' method='post'> <input type='submit' value='Play Tombola!'> </form> </center> <It Shall Be Done> Link to comment Share on other sites More sharing options...
jvanegmond Posted March 11, 2009 Share Posted March 11, 2009 huskies, in your case the button is the only element in the form. You could enumerate forms, take the first item, then enumerate the elements, take the first item which is your button. and to set focus to an element you can _IEAction($oElem, "focus") ( i think ) github.com/jvanegmond Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 11, 2009 Share Posted March 11, 2009 You will get different control id and text every time when you run the script. So we don't have any fixed control id or text for our script. We can not use this method in this situation.Form elements like buttons in a web page do not have control IDs at all. They are Document Object Model (DOM) elements which IE gives AutoIt a COM Object interface to. You should be learning to use the IE.au3 UDF function ( _IE* ) in the help file to work with your page.If you know how to solve this problem then reply immediately plz.You really should try to not sound so desperate/demanding. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
anand Posted March 12, 2009 Author Share Posted March 12, 2009 Thanks for your information. Next time i will take care about words(desperate/demanding). Can you please send me the code to identify control names present in a page. Please give me example for google page. Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 12, 2009 Share Posted March 12, 2009 Thanks for your information. Next time i will take care about words(desperate/demanding).Can you please send me the code to identify control names present in a page. Please give me example for google page.All of the _IE* functions in the help file have excellent example scripts. Run those first and see how the object references to the various elements are retrieved and used. There is no point in me writing duplicate demos when there are so many good ones in the help file.I understand that after checking out all those example scripts, you may not understand everything, but you will be able to ask a more direct question. It's a learning curve worth climbing. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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