0

I am trying to test "export to csv" feature, I am getting an error Element is not clickable at point (967, 125). Other element would receive the click:

Here is my code :

describe('csv download link', () => {
            it('should get the csv table export', () => {
                var exportToCsv = element(by.css('a[ng-click="vm.exportToCsv()"]')).click().then(() => {
                    var filename = 'lastPublishedPage.csv';
                    expect(downloader.downloadedFileExists(filename)).toBe(true);
                });
            });
Calum
  • 1,889
  • 2
  • 18
  • 36
  • When you watch, is the field on screen? This error can sometimes happen when the field exists, but needs to be scrolled to. – Jeremy Kahan Aug 31 '16 at 00:23

1 Answers1

0

This is a duplicate question, please look at here

Protractor + chrome driver: Element is not clickable at point

Here is the answer

You should set window size in your config file

onPrepare: function() {
  browser.manage().window().setSize(1600, 800);
}

If it still doesn't work you should scroll to the element's location

describe('csv download link', () => {
    it('should get the csv table export', () => {
        // scroll to exportToCsv's location
        browser.executeScript('window.scrollTo(967, 125);');

        var exportToCsv = element(by.css('a[ng-click="vm.exportToCsv()"]')).click().then(() => {
            var filename = 'lastPublishedPage.csv';
            expect(downloader.downloadedFileExists(filename)).toBe(true);
        });
    });
});
Community
  • 1
  • 1
patronaviera
  • 35
  • 1
  • 7