1

I'm automation a login to a web page and then exporting data by clicking in a exporting button in the web page.

The problem is that when I call the button:

ie.document.getelementsbytagname("DTTT btn-group").click

I get an error message telling that the method don't apply to the object.

The web code when I select the button is:

    <div class="DTTT btn-group">
    <a class="btn xls_icon_class downLoadIcon_dataTable"

id="ToolTables_documentos_0" data-original-title="">
    <span></span>
    <div style="left: 0px; top: 0px; width: 16px; height: 16px; position: 

absolute; z-index: 99;">
    <embed name="ZeroClipboard_TableToolsMovie_1" width="16" height="16" 

align="middle" id="ZeroClipboard_TableToolsMovie_1" pluginspage="http://www.macromedia.com/go/getflashplayer" 

src="/factemipf_static/swf/copy_csv_xls_pdf.swf" type="application/x-

shockwave-flash" wmode="transparent" flashvars="id=1&amp;width=16&

amp;height=16" allowfullscreen="false" allowscriptaccess="always" 

bgcolor="#ffffff" quality="best" menu="false" loop="false"></div></a></div>"

Help will be appreciated.

6
  • The DTTT btn-group is a CSS Style, not a tagname.... probably you should use ie.document.getElementById... Commented May 6, 2015 at 9:39
  • See here... Commented May 6, 2015 at 9:41
  • I've tried it too, but it won't work anyway. Commented May 6, 2015 at 10:38
  • So actually you want to trigger the export button action of the JQuery DataTable via IE Automation... Commented May 6, 2015 at 10:52
  • Is the button actually a button or does it call javascript? Commented May 6, 2015 at 10:53

2 Answers 2

1

Chances are you need to click the <a>.

ie.document.getElementById("ToolTables_documentos_0").click

But more information, like event listeners, is required to know for sure.

Sign up to request clarification or add additional context in comments.

3 Comments

I've tried it too, but it won't work . Where can i find that event listeners information?
You can inspect the elements with Developer Tools in the browser. It's not full proof but it's helpful. In Chrome when you inspect an element you have Event Listeners on the right.
I cannot inspect the element in internet explorer because that option won't apear, only some version flash details. What does it mean?
1

There is no URL and perhaps more HTML is required.

Your initial error is because you are trying to use the method of a single element on a collection.

This, ie.document.getElementsByTagName("DTTT btn-group"), returns a collection.

You would use an index to specify which element to click on:

ie.document.getElementsByTagName("DTTT btn-group")(0).Click

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.