Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

233
Vistas
'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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda