elmoi0010 Posted November 7, 2014 Share Posted November 7, 2014 Hello guys, am back to the comunity<3.. Well i have a problem triying to click a button in a "DIV" tag.. But there is another problem. There is another "btn3" in other "DIV" button look. Anyone can help me? Thanks in advanced. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 7, 2014 Moderators Share Posted November 7, 2014 1. There is no representation code that you've supplied that is failing. 2. No idea what you're accessing (a browser?). 3. No idea what methods you're using to access. A simple guess, and as much information as you provided would result in the below synopsis. Step through the all the tag names that are of "class". Get their value Depending on what you're using to access the data, the items you're stepping through are probably already objects, so use whatever method you use for other items to click. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
elmoi0010 Posted November 7, 2014 Author Share Posted November 7, 2014 (edited) 1. There is no representation code that you've supplied that is failing. 2. No idea what you're accessing (a browser?). 3. No idea what methods you're using to access. A simple guess, and as much information as you provided would result in the below synopsis. Step through the all the tag names that are of "class". Get their value Depending on what you're using to access the data, the items you're stepping through are probably already objects, so use whatever method you use for other items to click. Oh sorry i got the code here is it, and is not falling i just get two poop ups with the name of the buttons in the divs.. $oDivs = _IETagNameGetCollection ($amf_IE, "div") For $oDiv in $oDivs If $oDiv.classname == 'btn3' Then MsgBox(0,"",$oDiv.classname) ExitLoop EndIf EndIf Next Thanks in advanced and sorry. Edited November 7, 2014 by elmoi0010 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 7, 2014 Moderators Share Posted November 7, 2014 Yes, that's what my assumption was. You've done the classname bit, now you must get it's value so you know which to click. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
elmoi0010 Posted November 7, 2014 Author Share Posted November 7, 2014 Yes, that's what my assumption was. You've done the classname bit, now you must get it's value so you know which to click. Something like get the two pop ups in an array? Then click the second array? Something like.. $oDivs = _IETagNameGetCollection ($amf_IE, "div") For $oDiv in $oDivs If $oDiv.classname == 'btn3' Then $Arr[3] $arr[1] = Add new site/Page Arr[2] = Like _IEaction($Arr[2],"click") ExitLoop EndIf EndIf Next Can you help me? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 7, 2014 Moderators Share Posted November 7, 2014 I've no idea what you're referring to with "Popup". That was not in your original post. When you're unable to explain in detail exactly what is going on (step by step), then you need to provide a link to what you're working on. and what you're trying to accomplish with that link. It gets increasingly difficult to assist when new items are working their way in each post that could cause potential issues. So either provide step by step what is going on (maybe even with screen shots), a link to the site and what you're trying to accomplish so we can recreate the issue ourselves, or code with detailed comments of where it is failing, and why you think it may be failing. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
elmoi0010 Posted November 7, 2014 Author Share Posted November 7, 2014 I've no idea what you're referring to with "Popup". That was not in your original post. When you're unable to explain in detail exactly what is going on (step by step), then you need to provide a link to what you're working on. and what you're trying to accomplish with that link. It gets increasingly difficult to assist when new items are working their way in each post that could cause potential issues. So either provide step by step what is going on (maybe even with screen shots), a link to the site and what you're trying to accomplish so we can recreate the issue ourselves, or code with detailed comments of where it is failing, and why you think it may be failing. .. Thanks for you help bro. Link to comment Share on other sites More sharing options...
Inververs Posted November 7, 2014 Share Posted November 7, 2014 Add site is innerText. So: $oDivs = _IETagNameGetCollection ($amf_IE, "div") For $oDiv in $oDivs If String($oDiv.classname) = 'btn3' And String($oDiv.innerText)= 'add site' Then ;click here ExitLoop EndIf EndIf Next Link to comment Share on other sites More sharing options...
junkew Posted November 7, 2014 Share Posted November 7, 2014 try iuiautomation faq question 31 FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
EvandroAguiar Posted March 6, 2015 Share Posted March 6, 2015 no working for me..... Link to comment Share on other sites More sharing options...
EvandroAguiar Posted March 6, 2015 Share Posted March 6, 2015 Local $oInputs = _IETagNameGetCollection($Adds, "div") For $oInput In $oInputs If $oInput.classname == "btn3" Then _IEAction($oInput, "click") Next its problem is next ! need it stops for a few seconds until the pop up open and close the event takes place, then run the next turning the same page pop up, is? help me please my email pxlove@hotmail.com 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