Sign in to follow this  
Followers 0
rtorno

Need to click a button in a website with no ID and no name in source code

2 posts in this topic

I just started using autoit and I need help to click a button with no ID or name in the source code. here's part of the source code of the site:

if(report.EnableLoadButton) {
            $('<button onclick="loadReport(); return false;" class="btn-block btn btn-primary">Load Report</button>').appendTo(buttonDiv);
        }
        $('<div class="ui-helper-clearfix" style="clear: both;"/>').appendTo(buttonDiv);
        
 
        var iconList = $('<div class="exportButtons"></div>');
 
        if (report.EnableExcelExport == true) {
            //$('<button onclick="loadExcel(); return false;" class="reportButton" title="Export Excel">E</button>').appendTo(buttonDiv);
 
            var excelItem = $('<button type="button" class="btn btn-default btn-xs" title="Export Excel"><span class="glyphicon glyphicon-download"></span></button>');
            var excelButtonText = $('<button type="button" class="btn btn-default btn-block hidden-md hidden-lg" title="Export Excel">Export Excel</button>');
 
            var click = function () {
                loadExcel();
                return false;
            };
 
            excelItem.click(click);
            excelButtonText.click(click);
            iconList.append(excelItem);
            //buttonDiv.append(excelButtonText);

I need to specifically click on the button to Export to Excel. The one with the code

<span class="glyphicon glyphicon-download"></span>

Sorry, I'm just green in programming. TIA

Share this post


Link to post
Share on other sites



What have you tried thus far? You didn't specify, so I assume you intend to use IE. Have a look at the help file entry for _IETagNameGetCollection.

Share this post


Link to post
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
Sign in to follow this  
Followers 0