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

JsonPath shortcut not working in called feature when a variable is set in karate-config.js #1687

Closed
workwithprashant opened this issue Jul 22, 2021 · 1 comment
Assignees

Comments

@workwithprashant
Copy link

Environment: Karate 1.1.0.RC5 | JDK 14 | Maven 3.6.3

Example: Download project, extract and execute maven command mvn clean test -P functional

  1. generic_functions.feature is reading json file and saving it to masterList variable
  2. generic_functions.feature is called in karate-config.js
  3. When main feature file is executed, it's able to process * def usersKittens = $masterList[*].id without any issue.
  4. If main feature file calls another feature file and tries to execute * def allKittens = $masterList[*].id then it throws an error.
19:51:44.152 [pool-1-thread-1] ERROR com.intuit.karate - classpath:examples/library.feature:8
* def allKittens = $masterList[*].id
java.lang.NullPointerException
classpath:examples/library.feature:8

Note: masterList variable is accessible in called feature file as shown here

@ptrthomas ptrthomas self-assigned this Jul 22, 2021
ptrthomas added a commit that referenced this issue Jul 22, 2021
@ptrthomas
Copy link
Member

@workwithprashant fixed. closing as for an "in development" version

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

No branches or pull requests

2 participants