Thomas Moore admin


Thomas Moore
Last Active
Admin, Staff
  • Re: How can you use a specific row from a writable datasource in a subsequent test?

    Hi Kamit,

    For "New Datasource," you do not have to provide the absolute path. Instead, provide the name of the Excel Datasource that you are using for that specific test. In a similar script for the example screenshot below, the line would be

    context.getValues("Books", "title").get(4);

    Hope this helps!

  • Re: Lightweight Scripting of Datetime Fields in JSON Responder

    Hi Alex,

    If you are using version 9.10.2 of Virtualize, then we added a tool called the Data Generator Tool that you can use to generate timestamps in that manner without scripting.

    In prior versions of the tool, you will need to script the field to send the current date. If you are using javascript, then the following script should work for you:
    function time(){ return new Date().toISOString(); }

    Hope this helps!

  • Re: Write file tool - to get the specific values written to the file

    Hi Saranya,

    EDIT: If you're wanting to write the request XML to a file, follow the below, otherwise use Keegan's suggestion.

    An alternative to the above would be to use chained tools to grab the appropriate values and write them to a file. For example, I recommend using an XML Transformer to grab all of the values you wish to write to a file, and then chain the write file tool to the XML Transformer.

    Doing so will create the file you are looking for with the values that you are expecting.

    One thing to note: The XML Transformer creates new lines as \n, so Windows' default notepad will not recognize new lines (notepad only recognizes \r\n). Instead, use a text editor like notepad++ or sublime to view the output in the correct format. Alternatively, you can also write a short script that will correct this for use in notepad.

    Hope this helps!

  • Re: How can you use a specific row from a writable datasource in a subsequent test?

    Hi Brian,

    If you want to use a specific row from the datasource, the best way to do this that I can think of is to use a scripted value instead of parameterized.

    When you click the Edit script button when script is selected, paste this in with Groovy as the selected language:

    import com.parasoft.api.*;
    public String getFifth(ScriptingContext context)
        return context.getValues("New Datasource", "test").get(4);

    In your case, "New Datasource" should be the name of your writable and "test" should be the column name.

    Hope this helps!

  • Re: Configuring Class Path in CTP. or How to use java in CTP.

    Hi Rahul,

    When you're using java in CTP Extension Tool scripts, you will need to make sure the classpath is set for the SOAtest/Virtualize instance that is connecting to CTP, and not CTP itself.

    If you go to the API Testing page, click on the three dots on the right and create a folder on the server of your choice called "system_jars". Once the folder is created, click on it in the tree view and again click on the three dots on the right and choose upload file. Upload the jars that you wish to add to your classpath, and you should be ready to go.

    Hope this helps!