Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98817

Unable to return chrome://downloads/ list from a Protractor download test case

$
0
0

Allright , so I had this function written a while ago and it was working well.
Basically I'm downloading a file and then checking if there is 1 item in chrome://downloads/ and if the filename matches

this.checkDownload = async function checkDownload(fileNameRegEx) {
    var regex = new RegExp(fileNameRegEx);
    if ((await browser.getCapabilities()).get('browserName') === 'chrome') {
        await browser.get('chrome://downloads/');
        const items = await browser.executeScript('return downloads.Manager.get().items_');
        expect(items.length).toBe(1);
        expect(items[0].file_name).toMatch(regex);
    }
};

And today I had to reuse it and it throws an error :

Cannot read property 'get' of undefined

I think the issue is that downloads.Manager is undefined.
Has there been anything changes to Chrome api? Something has a new name?
I couldnt find any documentation on this.
I tried looking through the downloads object but I could not find any property/method that lists downloaded items.


Viewing all articles
Browse latest Browse all 98817

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>