Service Virtualization

JSR223 Script Working at local but not at VSE

  • 1.  JSR223 Script Working at local but not at VSE

    Posted 26 days ago

    Hello All,

     

    I have a scenario wherein I have to place a file at share path whenever I get a request to my virtual service. I have added JSR223 script in my VSM and written below script to copy the file to the share path :

     

    random={{=RandomNum}}
    def sourceFile = new File('\\\\sharepath/122.pcl')
    def destinationFile = new File('\\\\sharepath/'+random+'.pcl')
    destinationFile << sourceFile.text
    testExec.setStateValue("propertyText", random);

     

    When I am testing this script from my model file manually, script is getting executed successfully and I am able to see the file at the share path but when I deploy the service at VSE and tried to test it , it is not working.

     

    Kindly suggest what could be the reason and the way out .

     

    Thanks,

    Prasanna