-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Screenshot function causes undefined httpResponse #940
Comments
Thanks to Daniel for raising the bug. I have updated node to 7.3.0 just in case and the issue remains. I have also removed and re0installed nightmare a couple of times. The screenshot is rendered and then nightmare seem to stall I have run a debug and the output is below: Here's the code: `var Nightmare = require('nightmare'); Nightmare().goto("https://google.com")
|
@dnyg var Nightmare = require('nightmare');
var nightmare = Nightmare();
nightmare.goto("https://google.com")
.then(function(httpResponse) {
if(httpResponse.code == 200) {
return nightmare.screenshot('abc.png');
}
else {
//error condition?
throw new Error('http response was not ok');
}
})
.then(function(){ return nightmare.end(); })
.catch(function(){ return nightmare.end(); })
.then(function(){
console.log('done');
}) @TheTechy your code suffers from the same issue - the additional problem here is you're trying to access |
Hey Ross, Thanks for your answer. The code posted by Daniel originally was mine :) Thanks again for your help & please close the issue. |
@TheTechy Ah, cool. :) No problem, happy to help. |
The following code works flawlessly without
screenshot()
, but for some reason the httpResponse is undefined when thescreenshot()
function is present.Nightmare version is 2.9.0
Node version 6.9.1
The text was updated successfully, but these errors were encountered: