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.
Generating a unique number
For writing to an XML Data BankTo generate a unique number so that you may write that number to an XML Data Bank for use within another test you can use the following script. Within a method tool make sure python is the selected language and then enter this script. You can then chain an XML Data Bank to the method tool, which will allow the unique number to be saved and used in another test. You can change the MASK variable to allow you generate a number of whatever length you wish.
from soaptest.api import *
MASK = 1000
def getURL(input, context):
# returns a unique number
num = 1000 + SOAPUtil.getUniqueNumber()
# returns XML allowing the number to be stored in the XML Data Bank
return SOAPUtil.getXMLFromString( [ str(num) ] )
return "Generated Data Sources"