Hi,
I am trying to create new users using the virtualized service and have the virtualized service return a list with existing users + the newly created user. However, I am unable to find such options while tinkering with the image file.
I have thought of some "possible" ways but it seems too complicated to implement it and would like to hear some opinions from the community here. If there are other ways to implement this or an existing guide into implementing 1 of the options below to fulfill my objective of having a dynamic list returned for my test using the virtualized service.
First option - to create a new element into the response image file with the properties to read the request information and return it. But, I believe that it will only solve the problem partially as every time the user create a new user, it will always overwrite that same entry.
Second option - to create a data set and have the image read/write from the data set in the .vsm. However, I am unsure if adding such dataset will complicate the workflow for the .vsm file and also I am not very comfortable enough with the javascript to attempt this.
Appreciate any help rendered.
Thanks!
Eric
You need a Java Script in VSM to read a file, get the list, add new user to the list and save it as a property and then write it to the file. Then return this property in VSI.
Disadvantage: you would need to manually clean the list (.txt) from the server when you want to reset it.
You can also keep saving the list in memory. Advantage: You avoid the file read/write hence the service faster and more robust. Everytime you restart, the list initializes to 0 users.
Disadvantage: Not good if the list of users is huge.