Unanswered question

How to replace the value inside a file that was located in local using javascript?

Hi Need help.

I have a scenario where after reading the file, it needs the value inside that file to be replaced.

We have this script from our JMeter where we based our script from. (PLease refer to the picture attached.

I tried doing it in the Neoload, using the replace() but it's not working. Does anyone knows what code to use?

Thank you.

Ann Jennifer E.
Ann Jennifer E.

Ann Jennifer E.

Level
0
56 / 100
points

Answers

Neil W.
Neil W.

Neil W.

Level
4
5000 / 5000
points
Team

It's hard to read your example with all the redacted content. Javascript does have a replace option for strings, you could also use a regular expression to replace values. Are yiou able to provide the file?

Ann Jennifer E.
Ann Jennifer E.

Ann Jennifer E.

Level
0
56 / 100
points

Hi Neil, thank you for responding to my question.

Sorry, this is the picture of the code that I'm using in Neoload javascript now, but with this code it was not able to replace the text it's supposed to changed. (Please refer to the picture attached.)

It was able to copy the file from sourcefolder to destination folder, but the details inside of that file was not changed.

Ann Jennifer E.
Ann Jennifer E.

Ann Jennifer E.

Level
0
56 / 100
points

This has been fixed. Thank you.

Neil W.
Neil W.

Neil W.

Level
4
5000 / 5000
points
Team

Hi, I'm pleased you were able to resolve this, it was next on my list for today