Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

232
Visualizações
How to repeat gherkin snippet in Karate?

I have a snippet of Gherkin that builds a JSON body and makes an API call.

I can reuse this snippet in other Karate features via:

* call read("/path/to/snippet.feature")

I have a scenario where I need to repeat this API call, so I want to run this snippet N times.

karate.repeat() exists; however, despite the name, it does not work with Karate gherkin files, or even def'ed Karate functions based on a feature file. Apparently, it only works with JS functions.

How do I repeat a call read() of another feature file an arbitrary number of times without having to explicitly repeat the line that many times? This could get unwieldy in a scenario where the number of calls needed for the scenario is more than a small few.

It seems the only solution is to re-implement that feature as a JS function, so that now I have both a Gherkin and a JS definition of the exact same functionality, which is a pattern that is begging for maintenance nightmares.

How can I call a Karate feature file multiple times in another Karate feature?

about 4 years ago · Santiago Gelvez
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda