You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
Here is the code I am testing, it does not return response every time. Like I run it 20 times, there is only one time I could get output of the body. Other times, I got nothing output, even not seeing any error messages.
I guess it is because the request runs too fast to get response back.
Could anyone help me with this?
Thanks.
I added output within the function(err,response,body), like below. But nothing got output.
get_from_google : function (callback) {
request('http://www.google.com', function(err, res, body) {
console.info('In the callback');
if (err)
return callback(err);
if (res.statusCode === 200) {
callback(new Error('Nothing got back'), body);
} else {
callback(new Error('Unexpected status code: ' + res.statusCode));
}
});
}
Here is console output:
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
Selenium standalone server started at http://10.33.203.210:53537/wd/hub
Started
.
Ran 1 of 3 specs
1 spec, 0 failures
Finished in 0.019 seconds
Shutting down selenium standalone server.
[launcher] 0 instance(s) of WebDriver still running
[launcher] chrome #1 passed
Process finished with exit code 0
The text was updated successfully, but these errors were encountered:
Here is the code I am testing, it does not return response every time. Like I run it 20 times, there is only one time I could get output of the body. Other times, I got nothing output, even not seeing any error messages.
I guess it is because the request runs too fast to get response back.
Could anyone help me with this?
Thanks.
I added output within the function(err,response,body), like below. But nothing got output.
get_from_google : function (callback) {
request('http://www.google.com', function(err, res, body) {
console.info('In the callback');
if (err)
return callback(err);
if (res.statusCode === 200) {
callback(new Error('Nothing got back'), body);
} else {
callback(new Error('Unexpected status code: ' + res.statusCode));
}
});
}
Here is console output:
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
Selenium standalone server started at http://10.33.203.210:53537/wd/hub
Started
.
Ran 1 of 3 specs
1 spec, 0 failures
Finished in 0.019 seconds
Shutting down selenium standalone server.
[launcher] 0 instance(s) of WebDriver still running
[launcher] chrome #1 passed
Process finished with exit code 0
The text was updated successfully, but these errors were encountered: