Facing issue while executing the cucumber testcases

cucumberissue.txtHi,

When I am executing the cucumber testcases for secured urls (https) I am getting below issue.

Error : getaddinfo Enotfound.

PFA for more details.

0 10 1,101
10 REPLIES 10

This suggests it cannot hit the url you have defined.

Is api-test.xx-xx.com/identity really the url?

it is client url and I cannot provide the urls.

above is the correct url only but it is confidential.

Thanks,

Kumar.

I am getting connection time out issue when I am working in client network but not with my personal laptop.

I tried to set the 'Proxy-Authorization' header detail also.

Please provide the suggestions.

changed the code in apickli.js

Apickli.prototype.addProxyBasicAuthorizationHeader = function(username, password) {
username = this.replaceVariables(username);
password = this.replaceVariables(password);
var b64EncodedValue = base64Encode(username + ':' + password);
this.addRequestHeader('Proxy-Authorization', 'Basic ' + b64EncodedValue);
};

Log details.

requested URL http://importantorganization-test.apigee.net/mock-api/html
host URL importantorganization-test.apigee.net
req self [object Object] arguments[object Arguments]
error Error: connect ETIMEDOUT 54.210.253.143:80
× When I GET mock-api/html
- Then response code should be 200

Failures:

1) Scenario: I should get default response code if no mock headers are supplied - tests\integration\FuncionalTests.feature:5
Step: When I GET mock-api/html - tests\integration\FuncionalTests.feature:7
Step Definition: tests\integration\step_definitions\apickli-gherkin.js:38
Message:
TypeError: callback.fail is not a function
at D:\LocalData\ukx9010\Downloads\amok-master\examples\apigee-amok\tests\integration\step_definitions\apickli-gherkin.js:41:14
at Request._callback (D:\LocalData\ukx9010\Downloads\amok-master\examples\apigee-amok\tests\node_modules\apickli\apickli.js:124:24)
at self.callback (D:\LocalData\ukx9010\Downloads\amok-master\examples\apigee-amok\tests\node_modules\request\request.js:187:22)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at Request.onRequestError (D:\LocalData\ukx9010\Downloads\amok-master\examples\apigee-amok\tests\node_modules\request\request.js:850:8)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at Socket.socketErrorListener (_http_client.js:310:9)
at emitOne (events.js:96:13)

1 scenario (1 failed)
3 steps (1 failed, 1 skipped, 1 passed)

Thanks,

Kumar

So, correct me if I am wrong:

You can use your confidential url form Chrome and it gives you response, but your cucumber test is not working?

Are you working within Intranet? Did you get proxy settings correct for the cucumber http client?

Thanks for quick response.

Yes cucumber test case is not working.The Problem is I am not able to run any cucumber test cases successfully in the client network but from my personal laptop (open network) the same above test cases working fine.

mock.js code is :

var apickli = require('apickli'); // set the url and base path for your API endpoint on Apigee edge var url='importantorganization-test.apigee.net/mock-api'; var env = process.env.NODE_ENV || 'dev'; // debug console.log('running on ' + env + ' environment'); module.exports = function() { // cleanup before every scenario this.Before(function(scenario, callback) { this.apickli = new apickli.Apickli('https', url); callback(); }); };

setting Proxy-Authorization code in apickli.js

Apickli.prototype.addProxyBasicAuthorizationHeader = function(username, password) {
username = this.replaceVariables(username);
password = this.replaceVariables(password);
var b64EncodedValue = base64Encode(username + ':' + password);
this.addRequestHeader('Proxy-Authorization', 'Basic ' + b64EncodedValue);
};

Thanks,

Kumar.

The problem currently is not an authorization header. The problems seems to be an https_proxy setting for your request call.

You need to set it up according to this link: https://community.apigee.com/articles/37598/configuring-https-proxy-for-dev-and-runtime-compon.html

To verify this, you can first try to use a curl call to obtain a result from your end point, again using curl http proxy setting from the link above.

Thanks Ylesyuk,

I have followed mentioned the article and eventhough issue not resolved.

Given I have proxy authentication credentials ukx901012 and password123
requested URL http://importantorganization-test.apigee.net/mock-api/html
host URL importantorganization-test.apigee.net
req self [object Object] arguments[object Arguments]
error Error: connect ETIMEDOUT 54.210.253.143:80
[31m× When I GET mock-api/html[39m
[36m- Then response code should be 200[39m

Failures:

1) Scenario:[1mI should get default response code if no mock headers are supplied[22m -[90mtests\integration\FuncionalTests.feature:5[39m
Step:[1mWhen I GET mock-api/html[22m -[90mtests\integration\FuncionalTests.feature:7[39m
Step Definition:[90mtests\integration\step_definitions\apickli-gherkin.js:38[39m
Message:
[31mTypeError: callback.fail is not a function
at D:\LocalData\ukx9010\Downloads\amok-master\examples\apigee-amok\tests\integration\step_definitions\apickli-gherkin.js:41:14
at Request._callback (D:\LocalData\ukx9010\Downloads\amok-master\examples\apigee-amok\tests\node_modules\apickli\apickli.js:124:24)
at self.callback (D:\LocalData\ukx9010\Downloads\amok-master\examples\apigee-amok\tests\node_modules\request\request.js:187:22)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at Request.onRequestError (D:\LocalData\ukx9010\Downloads\amok-master\examples\apigee-amok\tests\node_modules\request\request.js:850:8)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at Socket.socketErrorListener (_http_client.js:310:9)
at emitOne (events.js:96:13)[39m

Thanks,

Kumar.

1. Did you do:

"To verify this, you can first try to use a curl call to obtain a result from your end point, again using curl http proxy setting from the link above."

2. Your failure is: callback.fail is not a function

What is your callback definition?

Thanks for your help ylesyuk.

Issue resolved by doing the below steps.

1. we need to set up http proxy and https proxy in eclipse.

if the issue is not resolved by setting above things then do the below step.

2. set environment variables for http and https

variable name = HTTP_PROXY

value = http://username:password@hostname:port;

variable name = HTTPS_PROXY

value = %HTTP_PROXY%

Thanks,

Kumar