Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Scripting input field data

LegacyForum
LegacyForum Posts: 1,664 ✭✭
edited December 2016 in SOAtest
Hi there,

I would like to know if it is possible to add codes to dynamically define the value of an input field.

For example, if I need to perform a boundary test for a date field that allows to be post dated up to 90 days. Instead of inputting a fixed date, and that cannot be regression tested in the future (as the date has changed), is there a way we can write some codes to achieve this? (I see that there are options to code in Java / Javascript / Python for scriptXML, I am more familiar with Java / Javascript)

Thanks for your help and I look forward to hearing some feedback.

Wendy
Tagged:

Comments

  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    edited May 2006
    It is possible to do boundary checks using a script. I've attached an example test suite. In the example, the script checks whether the value is >= 0.0 and <= 20.0. <br />
    Since you need it for the input, you can use the script option for an input. For instance, in the SOAP Client, next to an input is a drop down box where you can select Fixed, Parameterized(if data source is available), Script, and Auto. You could use the Script option to dynamically make the input according to a boundary. The return value is what will be used in the input.

    Let me know if you have questions.
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    I've attached another example that shows how to use scripts for the input.
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Hi, I had a question about the same topic, so I wasn't sure whether it needed its own thread.

    I understand how to enter a script to generate dynamic input for a given field, and I have been able to do this succesfully in most cases. However there is one input field that it won't work for.

    I can enter fixed input and it works fine, but when i try to write a script for it, the value that is entered into the literal xml is '[script]'. I've even tried creating a script that just returns a hardcoded value, yet this has the same result.

    Thanks for your help
    -Justin
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    The "[script]" input is a known issue and was resolved in the most recent service pack. You can download the service pack at http://soatest.parasoft.com/sp/sp-soatest-4-5.xml