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.

How to verify the Data type in SOAtest

LegacyForum
LegacyForum Posts: 1,664 ✭✭
edited December 2016 in SOAtest
To verify whether or not a particular element's value is an integer or string, we can use an XML assertor with a *regular expression* assertion.
but in this option. If we know the length of the element's value, then we can use regular expressions. i.e. if the element contains 2 characters, i can use the regular expression as [0-9][0-9]. but if we are not sure of the length of the value, how can we do it. i.e. the element's value can be 2 or 3 or n character length.

Thanks in advance.
Tagged:

Comments

  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    edited December 2016
    You can do this quite easily in SOAtest using a compound assertion:

    1. Create a regular assertion set to [0-9][0-9]
    2. Create another regular assertion set to [0-9][0-9][0-9]
    3. Create a compound assertion and pick "OR Assertion"
    4. Double click the OR Assertion editor and add the first two regular expressions you created

    Let me know if you have problems figuring this out.

Tagged