AnsweredAssumed Answered

Loop in ExecuteScript using testExec and String Pattern not working properly

Question asked by sudarsunperu on Jun 7, 2018
Latest reply on Jun 8, 2018 by Mike_Gavaghan

When I try to use String Patterns in ExecuteScript(JSR-223), i find the following behaviour. This is weird.
Contents of Script
      testExec.setStateValue("hashId1","{{=[H*(32)]}}");
      testExec.setStateValue("hashId2","{{=[H*(32)]}}");
In the above scenario hashId1 and hashId2 are unique.
Contents of Script
      for(int i=1;i<3;i++){
            testExec.setStateValue("hashId"+i,"{{=[H*(32)]}}");
      }

In the above scenario hashId1 and hashId2 are exactly same.
Why is this behaviour happening? How to solve this.?

Thanks in Advance.

If there is a better way to use String Patterns in ExecuteScipt, please suggest.

Outcomes