LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to properly click button via ActiveX

I am trying to program a click to the submit/apply button on a web page of a product I am trying to test. The HTML code defines the buttons as follows:

 

                   <!-- buttons table starts here -->
                     <table cellspacing="0" cellpadding="0" border="0">
                      <tr>
                       <td><input type="submit" name="Button" value="Apply" class="button" /></td>
                       <td width="10"><spacer width="10" height="10"></spacer></td>
                       <td><input type="reset" name="Button" value="Cancel" class="button" /></td>
                       <td width="10"><spacer width="10" height="10"></spacer></td>
                       <td><input type="submit" name="Button" value="Help" class="button" /></td>
                       <td width="10"><spacer width="10" height="10"></spacer></td>
                       <td>                                                   </td>
                      </tr>
                     </table>
                    <!-- buttons table ends here -->

 

I am able to invoke a node for the other parameters in the webpage, and I am also able to change their values. In order to click the "Apply" button I have my code as follows (see attached picture).

 

My problem is that the button press does not work reliably... Any suggestions out there on how to program this button press better?

 

0 Kudos
Message 1 of 4
(3,260 Views)
I am not an HTML or webpage programmer.  But one thing I notice from your HTML code is that each item as the same name of "Button".  Could this be the problem?
0 Kudos
Message 2 of 4
(3,250 Views)

Indeed, I believe you are correct about the naming of all the buttons as "Button". Unfortunatley it is not my code, and I have no way of changing it.

I'm hoping I can get different ideas from some of the helpful folks on these forums 🙂

0 Kudos
Message 3 of 4
(3,226 Views)
Instead of accessing the button by name, access it by index. See the reference for IHTMLElementCollection.
0 Kudos
Message 4 of 4
(3,210 Views)