Karate: Getting issue "no variable found with name: response". Below is complete description.

Created on 9 Oct 2019  Â·  10Comments  Â·  Source: intuit/karate

My code was running fine before adding the 'And match response' step. After adding this step, i am getting below error. The interesting part is that even after removing this step, the error still occurs. I tried maven clean, project clean and other stuff. Karate version used is 0.9.4.

[main] ERROR com.intuit.karate - evaluation of 'karate-config.js' failed: javascript evaluation failed: read('classpath:karate-config.js'), no variable found with name: response

invalid

Most helpful comment

Hi,

Yes, Actually i added some comment in the .js file in the first line. When
i removed that comment, it started reading .js file.
I don't know how.

On Wed, Oct 23, 2019, 2:45 PM UmairKamran notifications@github.com wrote:

@RYRAJESH https://github.com/RYRAJESH Getting the same issue. Persists
even after I've removed everything. Did you figure out what it was?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/intuit/karate/issues/916?email_source=notifications&email_token=AJ6WB6YUHWAXEVN5NY6QXXDQQBBPFA5CNFSM4I7BJCF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECBITNI#issuecomment-545425845,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AJ6WB64FJCS5UL5AP4VYMSLQQBBPFANCNFSM4I7BJCFQ
.

All 10 comments

@RYRAJESH sorry, you have to follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

@RYRAJESH Getting the same issue. Persists even after I've removed everything. Did you figure out what it was?

Hi,

Yes, Actually i added some comment in the .js file in the first line. When
i removed that comment, it started reading .js file.
I don't know how.

On Wed, Oct 23, 2019, 2:45 PM UmairKamran notifications@github.com wrote:

@RYRAJESH https://github.com/RYRAJESH Getting the same issue. Persists
even after I've removed everything. Did you figure out what it was?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/intuit/karate/issues/916?email_source=notifications&email_token=AJ6WB6YUHWAXEVN5NY6QXXDQQBBPFA5CNFSM4I7BJCF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECBITNI#issuecomment-545425845,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AJ6WB64FJCS5UL5AP4VYMSLQQBBPFANCNFSM4I7BJCFQ
.

I can verify that this worked for me too.

Just ran into this, yes...don't have a comment as the first line in your JS

for me, the root was in a place much before response - when I set path
And path /path/path - forgot to get the path into quotes.
And path '/path/path' worked well

I had a comment as the first line of the ".js" file which was causing this issue. I know this would be documented somewhere not to have this first line as comments but I wish the error message was helpful. The following SO page helped me.
https://stackoverflow.com/questions/46918627/in-karate-dsl-calling-a-javascript-file-returns-java-lang-runtimeexception

@arisingh this is an open-source project, anyone here is welcome to submit a PR to improve the docs or code. I hope that is clear !

I understand @ptrthomas. I added this comment because google sent me to this page when I searched for the error - so I hope it will help others in my situation.

Also, it will help if instead of someone starting from scratch to find a solution, if someone who knows more about the codebase, to point me (or anyone else who may want to fix this) in the right direction. e.g. which part of the code may need change. Anyone knowing the codebase should be able to point this out quickly - which would then enable me (or anyone else) to create a fix in a reasonable amount of time.

@arisingh you can start by looking at the new version. there is a good chance this issue may be fixed or improved: https://github.com/intuit/karate/issues/1373#issuecomment-741991267

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bbchristians picture bbchristians  Â·  4Comments

khanguyen88 picture khanguyen88  Â·  3Comments

ampc picture ampc  Â·  5Comments

76creates picture 76creates  Â·  3Comments

hascode picture hascode  Â·  3Comments