Jump to content

Internet Explorer Object with no Name


Recommended Posts

Hi Guys, 1st time poster here.

So I am trying to "click" a button in IE and was going to use _IEGetObjById and _IEAction($ , "Click")

But the button I want to click on does not have a name when I view the source of the page.

It does appear that the button is attatched to a function on the page, so it would be great if I could "click" the button, or run the function on the page.

Below is extracts of the source. The details of the button, and the function the button is assigned to, is in bold and underlined.

Any help would be awesome.

<td>

<input class="button" type="button" value="Scheduler" onclick="doSchedule()">&nbsp;&nbsp;

<input class="button" type="button" value="Write To CSV" onclick="getCSV()">

</td>

<script language="Javascript">

<!--

function submitaction (action)

{

document.form1.submit();

}

function getCSV ()

{

document.form1.action="RptCSV.jsp";

submitaction ("");

}

function doSchedule ()

{

document.form1.action="TaskAdd.jsp";

submitaction ("");

}

-->

</script>

Link to comment
Share on other sites

Get all 'input' elements with _IETagNameGetCollection , loop trough them and compare its value to "Write To CSV" and then _IEAction($ , "Click")

The other option you can try is to call the "getCSV()" function.

Link to comment
Share on other sites

Thanks for that.

Ended up getting it working with _IETagNameGetCollection

$Tag = _IETagNameGetCollection($IE_Page, "input")
For $oInput In $Tag
If $oInput.value = "Write To CSV" Then
  $Button = $oInput
  ExitLoop
EndIf
Next
_IEAction (Button, "click")
Link to comment
Share on other sites

I have had an issue with some controls that do not show a Name or ID when I use AutoIt Window Info Tool on them. I am wondering if I could use similar code to find the Name/ID, or otherwise reference these controls.

Any ideas are appreciated.

TJ.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...