Home > Net >  Gatling framework latest version (3.8.4) function "EscapeJSIllegalChars" has been removed
Gatling framework latest version (3.8.4) function "EscapeJSIllegalChars" has been removed

Time:12-16

I updated gatling version to latest, but I am facing an issue I have been struggling a bit, there is a function"escapeJsIllegalChars" that is not present in this new version, I am updating from 3.3.1 to 3.8.4 I see that function is being used in the scala script of the project in order to escape some data like name etc. but after upgrading the gatling version that function is showing the error that it does not exist.

Do you have any idea if there is a similar new function added or changed in this new Gatling version that I could use?

Thanks in advance.

I have been researching documentation but I have not found anything helpful yet, I have also been checking on the gatling .jar file and I have compared the version 3.3.1 with the version 3.8.4 but in the latest version the function "escapeJsIllegalChars" does not exist.

CodePudding user response:

I see that function is being used in the scala script of the project in order to escape some data like name

This method has never been a public API. You've used an internal (used for reports generation, had nothing to do with load tests) you should never have.

Fork the original code and make it your own method, it's super simple:

  def escapeJsIllegalChars(string: String): String =
    string
      .replace("\"", """)
      .replace("\\", "\")
  • Related