Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

231
Views
'not a callable feature or js function' Error when calling JS function from feature file

While using Karate framework for API testing I am trying to call a method in one feature file from other like this:

    Scenario: Scenario description
  * def util = callonce read('UtilFunctions.feature')
  * def object = 
  """
    {"_yearsOffset":-20, "_daysOffset":0}
  """
  * def customerAge = call util.getDate(object)
  * print customerAge

The method just returns a date with a yearsOffset and daysOffset to move the date if desired.

When I execute this I have the following error:

not a callable feature or js function: [type: STRING, value: 30.03.2002]

Even though the value displayed in the log is correct and does what the function is asked to do, the execution fails.

Any guess? I am running out of ideas.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Here's a guess, you don't need to use call when simply invoking a function:

* def customerAge = util.getDate(object)

The call makes things a little bit easier to read only if it is a function

* def fun = function(x){ return { foo: x } }
* def customerAge = call fun 'bar'
# this will also work
# def customerAge = fun('bar')
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!