hejke Posted January 3, 2017 Share Posted January 3, 2017 (edited) Hello again. This time I can't click on a button. I've tried a few examples that I took from the forum, but none of them worked. Here's the HTML?: $.each(data.busca, function(i,datos){ var tbRow = '<tr class="terminal_row">'+ '<td><input type="button" size="5" class="atras" onclick="document.location=\'/'+lang+'/terminals_ng/edit/'+datos.id+'/'+datos.idPlatform+'\'" value="edit"/></td>'+ '<td>'+datos.name+'</td>'+ '<td>'+datos.identifier+'</td>'+ '<td>'+datos.mac+'</td>'+ '<td>'+datos.platform+'</td>'+ '</tr>'; $(tbRow).appendTo('#tabla_de_terminales'); $("#tabla_de_terminales tr:even").addClass("even"); Pic of the button (edit): My code: $oButtons = _IETagNameAllGetCollection($oIE, "input") For $oButton in $oButtons ConsoleWrite($oButton.innerText & @CRLF) Next But it doesn't work. I have only this error, but I don't know if it's related (I didn't use _IEAttach in any part of the code), --> IE.au3 T3.0-2 Warning from function _IEAttach, $_IESTATUS_NoMatch Thank you! Edited January 3, 2017 by hejke Add error Link to comment Share on other sites More sharing options...
Danp2 Posted January 3, 2017 Share Posted January 3, 2017 Sorry, but that doesn't make sense. How did you establish the value of $oIE? This is normally done via _IEAttach or _IECreate. Also, that looks like Javascript with some embedded HTML. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
hejke Posted January 4, 2017 Author Share Posted January 4, 2017 15 hours ago, Danp2 said: Sorry, but that doesn't make sense. How did you establish the value of $oIE? This is normally done via _IEAttach or _IECreate. Also, that looks like Javascript with some embedded HTML. The code I posted is not the complete one, I just posted the part with the problem. I used $oIE = _IECreate. Yes, I think is Javascript, but I have no knowledge os Javascript whatsoever, so I need help with this. Link to comment Share on other sites More sharing options...
Danp2 Posted January 4, 2017 Share Posted January 4, 2017 First things first. You will need to figure out which command is failing with the $_IESTATUS_NoMatch. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Juvigy Posted January 5, 2017 Share Posted January 5, 2017 Post a larger portion of the html. One or 2 levels up! Link to comment Share on other sites More sharing options...
hejke Posted January 6, 2017 Author Share Posted January 6, 2017 Resolved the problem with $_IESTATUS_NoMatch. It was a mistake I made with the code. Here's the complete javascript code: expandcollapse popup<script type="text/javascript"> var lang = "es"; function display_product_terminals(value){ var idbrk=value.split("-"); var url = "/"+lang+"/operaciones_terminals/get_terminals_by_product/"+idbrk[0]+"/"+idbrk[1]; $.getJSON(url,function(data){ if(!(data.busca)){ $.each(data.errores, function(i,datos){ var tbRow = '<tr class="terminal_row">'+ '<td colspan="5"><br><div class="error">'+datos.error+'</div><br></td>'+ '</tr>'; $(tbRow).appendTo('#tabla_de_terminales'); $('#nombre_terminal').append('<option value="" style="color:red;font-weight:bold;">'+datos.error+'</option>'); }); }else{ $.each(data.busca, function(i,datos){ var tbRow = '<tr class="terminal_row">'+ '<td><input type="button" size="5" class="atras" onclick="document.location=\'/'+lang+'/terminals_ng/edit/'+datos.id+'/'+datos.idPlatform+'\'" value="edit"/></td>'+ '<td>'+datos.name+'</td>'+ '<td>'+datos.identifier+'</td>'+ '<td>'+datos.mac+'</td>'+ '<td>'+datos.platform+'</td>'+ '</tr>'; $(tbRow).appendTo('#tabla_de_terminales'); $("#tabla_de_terminales tr:even").addClass("even"); }); } }); $("#tabla_de_terminales").css("display","block"); } function buscaTerminales(terminal_for_search){ $('.terminal_row').remove(); var url = "/"+lang+"/operaciones_terminals/busca_terminal_for_edit/"+terminal_for_search; $.getJSON(url,function(data){ if(!(data.busca)){ $.each(data.errores, function(i,datos){ var tbRow = '<tr class="terminal_row">'+ '<td colspan="5"><br><div class="error">'+datos.error+'</div><br></td>'+ '</tr>'; $(tbRow).appendTo('#tabla_de_terminales'); $('#nombre_terminal').append('<option value="" style="color:red;font-weight:bold;">'+datos.error+'</option>'); }); }else{ $.each(data.busca, function(i,datos){ var tbRow = '<tr class="terminal_row">'+ '<td><input type="button" size="5" class="atras" onclick="document.location=\'/'+lang+'/terminals_ng/edit/'+datos.id+'/'+datos.idPlatform+'\'" value="edit"/></td>'+ '<td>'+datos.name+'</td>'+ '<td>'+datos.identifier+'</td>'+ '<td>'+datos.mac+'</td>'+ '<td>'+datos.platform+'</td>'+ '</tr>'; $(tbRow).appendTo('#tabla_de_terminales'); $("#tabla_de_terminales tr:even").addClass("even"); }); } }); $("#tabla_de_terminales").css("display","block"); } Thank you! Link to comment Share on other sites More sharing options...
Danp2 Posted January 6, 2017 Share Posted January 6, 2017 Something like the follow may work -- #include <IE.au3> Local $oIE = _IEAttach("","instance") Local $oTable = _IEGetObjById('tabla_de_terminales') Local $oButtons = _IETagNameGetCollection($oTable, 'button') For $oButton In $oButtons _IEAction($oButton, 'click') Next Note that I said 'may' because you haven't shown us the final HTML, so I'm only interpreting the JS code and may not have done so correctly. ;-) Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
hejke Posted January 26, 2017 Author Share Posted January 26, 2017 On 6/1/2017 at 4:22 PM, Danp2 said: Something like the follow may work -- #include <IE.au3> Local $oIE = _IEAttach("","instance") Local $oTable = _IEGetObjById('tabla_de_terminales') Local $oButtons = _IETagNameGetCollection($oTable, 'button') For $oButton In $oButtons _IEAction($oButton, 'click') Next Note that I said 'may' because you haven't shown us the final HTML, so I'm only interpreting the JS code and may not have done so correctly. ;-) Didn't work either Link to comment Share on other sites More sharing options...
Danp2 Posted January 26, 2017 Share Posted January 26, 2017 1 hour ago, hejke said: Didn't work either You'll need to be more specific if you want further assistance. Where did it fail? Post the results from the Scite output window. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
hejke Posted February 1, 2017 Author Share Posted February 1, 2017 (edited) It worked in the end. I just had to use another name for _IEAttach. This is what worked: $oIEA = _IEAttach("","instance") $oTable = _IEGetObjById($oIEA, 'tabla_de_terminales') $oButtons = _IETagNameGetCollection($oTable, 'button') For $oButton In $oButtons _IEAction($oButton, 'click') Next Thank you! Edited February 1, 2017 by hejke Link to comment Share on other sites More sharing options...
Danp2 Posted February 1, 2017 Share Posted February 1, 2017 You're welcome. I just noticed that I left out the $oIE in the call to _IEGetObjById. Hope that did create confusion for you. ;-) Latest Webdriver UDF Release Webdriver Wiki FAQs 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