Answered question

How to flush an extracted value after each iteration

We are using a loop based on extracted value. If the value exists it will go to "Else".
Problem: Once it finds the value, for all subsequent iterations, it consider it exists. Is it possible to flush the extracted variable after the iteration is over?

Sachin G.
Sachin G.

Sachin G.

Level
1
121 / 750
points

I thought you were testing if the variable extractor exists and you were using that condition inside your loop. But if i understand correctly you are checking the content of your variable extractor and not the fact that it exists or not correct?

If it's really the content, you can override the value using a Javascript. You can use the setValue method with the same name of your extractor and assign any values.

Something like context.variableManager.setValue("MyExtractor","foo"); where MyExtractor is the name of your variable extractor.

Did you find this useful ?

No (0)

Yes (1)

100%

100% of users found this answer useful

Other answers

Using a NeoLoad Javascript you can clear all the runtime variables but that means it will clear not only your extractor but all. This is the method: clearRuntimeVariables()

For mor information, you can look at the NeoLoad documentation under APIs--> Javascript action API.

Otherwise you could use a Javascript to set a specific value to your extractor at the end of the iteration and in your loop condition check if you have that value or not.

Sachin G.
Sachin G.

Sachin G.

Level
1
121 / 750
points

Thanks Nouredine - It seems I don't have option to reply to your answer. I want to set only one extraction to Null. I tried JavaScript but not able to set it to NULL.