Closed mario8x closed 8 years ago
I created a nightmare as below:
const nightmare = createNightmare({ show: global.headless, waitTimeout: global.waitTimeout, // in ms maxDownloadRequestWait: 30000, paths: { downloads: downloadPath } })
@mario8x Thanks for the repro steps, I'll take a look at this and see what I can do.
The one thing that jumps out at me in the log is the did-fail-load
. I'd be curious what failed to load. If you perform the steps in your script by hand in Chrome, what does the development console say? What's failing to load on that last page? It looks like it's a hard network abort (error code -3).
I don't know if that's the whole cause, but it's certainly not helping.
If you'd like, I could prep a release that has more verbose logging and better error handling. What do you think?
Thanks for your feedback @rosshinkley . If you perform the steps in your script by hand in Chrome, what does the development console say?
I tried to use nightmare-download-manager and it work well. I guess the root cause is timeout configuration. My new script is as below: const nightmare = createNightmare({ show: config.show, waitTimeout: 240000, downloadResponseWait: 10000, paths: { downloads: path.dirname(filePath) } }) try { nightmare.on('download', function (state, downloadItem) { if (state == 'started') { nightmare.emit('download', filePath, downloadItem) } }) await nightmare .use(this._login({username: this._username, password: this._password})) .use(this._downloadProvisionFile(provisionName)) } finally { await nightmare.end() }
_downloadProvisionFile(provisionName) {
return (nightmare) => {
nightmare
.downloadManager()
.wait(config.objectTimeout)
.wait(elements.allProvisionFilesLnk)
.click(elements.allProvisionFilesLnk)
.wait(#grid-table td[title="${provisionName}"]
)
.click(#grid-table td[title="${provisionName}"]
)
.wait(config.objectTimeout)
.wait(elements.editBtn)
.click(elements.editBtn)
.wait(elements.selectAllDeviceCheck)
.check(elements.selectAllDeviceCheck)
.wait(elements.generateBtn)
.click(elements.generateBtn)
.wait(elements.downloadBtn)
.click(elements.downloadBtn)
.waitDownloadsComplete()
}
Hi, Currently, i got an issue when download a file from apple site This is my script:
. It throw an exception as below:
But the file is still download successfully. Please help me review it. I attached log file. nighmare_download.txt