Jsonpath vs Regex extractor

Sorry if this has been asked before - I’ve not managed to find an answer by searching.

In Gatling:

If I save some values using regex, I get a session variable of type List[String]
If I save some values using jsonpath, I get a session variable of type Vector[String]

Why are the two checks producing different types of session variable? I’m sure there’s a rationale behind it.

It makes it trickier if I want to using a single function to do something to the output of either.

To give an idea of the use cases - I might have a webpage where I am getting some data using regex, and then an REST API where I get similar/equivalent data in a different scenario, using jsonpath.

Is there any easy way around this?


List and Vector are implementations of the Seq contract. The actual type is an implementation detail and subject to change.
You should use Seq on your side.

Hi Stéphane,

Perfect, thank you - I was hoping that there would be a simple answer, so wanted to ask here in case anybody has the same question in future.


Translating to Java, it’s a bit like ArrayList vs LinkedList => you would use the List abstraction.