Skip to content
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

Newman vs. ASP.NET MVC Web API 2 "No HTTP resource was found" message #78

Closed
jlampeatds opened this issue May 13, 2014 · 5 comments
Closed
Labels

Comments

@jlampeatds
Copy link

Just tried running Newman 1.0.2 with node.js v0.10.28 on a 64-bit Windows 7 machine and received a "TypeError" error on a fairly common ASP.NET MVC Web API 2 error message.

D:\code>newman -c MVCWebApp03_test.json

Iteration 1 of 1
200 20ms Basic value to root http://localhost:26069/values/5
404 21ms Basic value http://localhost:26069/api/values/5

TypeError: Cannot read property 'two' of undefined
at getKey (C:\Users\tehuser\AppData\Roaming\npm\node_modules\newman\src\uti
lities\VariableProcessor.js:62:23)
at String.replace (native)
at Object.jsface.Class._findReplace (C:\Users\tehuser\AppData\Roaming\npm\n
ode_modules\newman\src\utilities\VariableProcessor.js:64:31)
at Object.jsface.Class._processPathVariable (C:\Users\tehuser\AppData\Roami
ng\npm\node_modules\newman\src\utilities\VariableProcessor.js:33:23)
at Object.jsface.Class.processRequestVariables (C:\Users\tehuser\AppData\Ro
aming\npm\node_modules\newman\src\utilities\VariableProcessor.js:107:8)
at Object.jsface.Class._processUrlUsingEnvVariables (C:\Users\tehuser\AppDa
ta\Roaming\npm\node_modules\newman\src\runners\RequestRunner.js:128:21)
at Object.jsface.Class.execute (C:\Users\tehuser\AppData\Roaming\npm\node
modules\newman\src\runners\RequestRunner.js:46:9)
at Object.jsface.Class._onRequestExecuted (C:\Users\tehuser\AppData\Roaming
\npm\node_modules\newman\src\runners\RequestRunner.js:80:8)
at EventEmitter.emit (events.js:117:20)
at Object.jsface.Class.emit (C:\Users\tehuser\AppData\Roaming\npm\node_modu
les\newman\src\utilities\EventEmitter.js:34:16)

Where “Basic value to root” returns:
"value"
…and “Basic value” returns:
{
"Message": "No HTTP resource was found that matches the request URI 'http://localhost:26069/api/values/5'.",
"MessageDetail": "No type was found that matches the controller named 'api'."
}

More info:

[email protected] C:\Users\jonathal\AppData\Roaming\npm\node_modules\newman
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], reque
[email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected])

@prakhar1989
Copy link
Contributor

Hi @jlampeatds, thanks for the stack trace. Looks like newman is failing at the third request. Is it possible for you to share the URL of the third request and make confirm if it is using any environment variable? Thanks!

@jlampeatds
Copy link
Author

Yep, you're right - it's not failing during the second, it's failing at the third.

Here's a "clean third" request that fails right away. (The most unusual part about this seems to be that there is an ampersand and a pair of colons in the URL.)

{"id":"49928258-dfdb-b352-ee7c-f2fbf099dcb8","name":"MVCWebApp03","timestamp":1399047632403,"order":["eccdd237-29dd-625a-45c6-757231a6faa5"],"requests":[{"collectionId":"49928258-dfdb-b352-ee7c-f2fbf099dcb8","id":"eccdd237-29dd-625a-45c6-757231a6faa5","name":"Value with path","description":"","url":"http://localhost:26069/values/one:two@three:four/resource/pathone/pathtwo/pathlast","method":"GET","headers":"CustomClientToken: badGUID\n","data":[],"dataMode":"params","timestamp":0,"version":2}]}

@prakhar1989
Copy link
Contributor

Ah ok. Looks probably like a bug with the path variables. Just to confirm the url that you have mentioned is the clean url (i.e url in the exported collection) - "http://localhost:26069/values/one:two@three:four/resource/pathone/pathtwo/pathlast".

We will have a fix ready soon. Thanks again for reporting the issue.

@prakhar1989 prakhar1989 self-assigned this May 14, 2014
@prakhar1989 prakhar1989 mentioned this issue May 14, 2014
@prakhar1989
Copy link
Contributor

Hi @jlampeatds, new version of Newman is out with this fix. You can update newman with npm install -g newman.

@jlampeatds
Copy link
Author

Updated and tested great back at the ranch. You guys are awesome - thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants