-
SOAtest 9.0---> WIN32COM.CLIENT
No module found for WIN32COM ERRORHi all, I am currently writing a Jython code where i am needing WINCOM32 Extensible Package .I am dispatching Excel using this. from win32com.client import Dispatch But when i am running the code , it says the above WIN32COM module is not found. Solution we used but not Successfull: We…
-
How to validate non-numeric field is ASC or DESC?
Hi All, type: REST API, method: GET 1)My JSON response contains list of documents, In which I have filename field (non-numeric). I can send a parameter in request to get all the documents sorted ASC or DESC on filename. I want to read the filename in response and check the order is ASC or DESC. 2) same way I also want to…
-
Updating a soavirt.war deployment with a Windows Batch script
This is a simple script that will allow us to update a soavirt.war based deployment when a new WAR is released SET SOAVIRT_LOCATION=C:\parasoft\SOAVIRTSET UPDATE_FOLDER=c:\parasoft\update\soavirtBackupsSET WAR_LOCATION=C:\parasoft\warsSET WORKSPACE_LOCATION=C:\parasoft\SOAVIRTworkspaceSET…
-
Using System and Environment Variables in your scripts
You can use system/ environment variables in your scripts. Here is a simple example from com.parasoft.api import *from java.lang import Systemdef systemVariables (input, context): #This is for Windows Application.showMessage("COMPUTERNAME = " + str(System.getenv("COMPUTERNAME"))) #This is for Linux…
-
Importing/ exporting Data in TDM using a script
TDM allows us to manage and manipulate data in CTP. There are many cases where we would want to store snapshots of our data in source control. The following scripts utilize the TDM apis to accomplish this.
-
Script instead of Diff to test return code
if i have a response that has CODE <responseCode>1436</responseCode> how can i do a diff that says the test PASSES as long as i don't get a responseCode of 1436? also, what if i want to do: the test PASSES as long as the responseCode is less than zero?
-
Scripting - Dynamic Input for Concurrent Testing
Dynamic Input for Concurrent TestingHello, I have such an issue, i should create a test suite with 100 tests which should run concurrently. In fact all 100 tests are the same , but i want to set an input parameter in the test between data range 2X0X and 3X0X ( X is the any number). So what i want is that : for all the…
-
Unable to add a assertion by custom scripting
I am trying to check if a number if positive or not by using XML asserter. After I have written the code I should get the function name in the Method drop down. But I am not able to see that. The drop down is empty. I have attached a screen shot for the same. Can someone please help me in resolving this? Regards Archana
-
Extracting Optional elements from response
Hi, I am testing a service which returns some optional elements in response traffic. I want to extract them in a method and kick off other tests based on the extracted values. Any suggestions on how can I achieve that?
-
How to Transform Expected Value to Regular Expression
Hello! I'm using a test that after execution, provides an element with the following value (used for a posterior test assertion): "VALUE1 VALUE2 VALUE3" Then, I'm asserting a set of fields that contains: "VALUE1", "VALUE2", "VALUE3" , respectively. I would like to transform the first value (stored as a DataTable Parameter)…
-
(Jython) How to read the contents of a file into a String
using JythonTo read the contents of a file into a String using a Jython script you can use the following method: CODEfrom java.lang import * from java.io import * from soaptest.api import * def getContents(input, context): contents = StringBuffer() reader = BufferedReader(FileReader(File("c:\Documents and…
-
Environment Variables
How to add environment variables to an Extension Tool TestHi, I have an extension tool task that generates a random value. This random value is formed by a fix value + current date + randomvalue. The fix value is stored as an environment variable, that changes in any environment I would like to add this value to the code,…
-
Verification using SOAP Response using external java class
Hi I have requirent where I have to use a SOAP Response parameter say id and use a external JAVA program which takes this id as a parameter and should return PASS or Fail if a SQL query passes using that id parameter . Not getting exactly how to pass a soap reponse value to a external Java Program. Standalone Java program…
-
String Operations Using Data Bank and Test Suite and Env. Variable Val
Hello Everyone, Below is an example of a Python script that extracts values from various sources (data bank, test suite variable, and environment variable) for use with string operations such as concatenation using the '+' operator... CODEfrom soaptest.api import * from com.parasoft.api import * # Gets a value from a data…
-
How to start scripting in SOAtest tool...
Hi I want to learn how to use scripting in SOATest tool. Please share how to start scripting in SOATest tool(say Python). Detailed info/docs/links would be appreciated. Thanks - Gopal
-
Browser Data Bank -> Output
View and save extracted valuesI'm running a Web test and at the end of it I extract a value to a Browser Data Bank (Browser Content->Browser Data Bank). How can I: 1) Inspect the data bank. i.e. view the extracted values 2) Write the extracted values to a file. Thanks, Amela
-
Saving output from JavaScript
I found some JavaScript that will give me the IP Address of the local machine where I am running tests and this code works quite nicely. CODE function GetIPAddress(input, context) { var ip = java.net.InetAddress.getLocalHost(); var ipStr = new java.lang.String(ip.getHostAddress()); return (ipStr); } The problem is that I…
-
Can Method Tool return custom XML structure
Normally, when I want to return an XML structure in a Method tool to be chained with a Data Bank I use the command: return SOAPUtil.getXMLFromString(["myStringList"] The format is always a simple list: <root> <z0>myString1</z0> <z1>myString2</z1> ... </root> Is there a way (either in Java or Jython) that I can create my…
-
Add a listener to the stop-button
Hello, I have a test scenario at which I start a SOAP request and check the response via the Call Back Tool. Afterwards I start a Java method with the help of the method tool. This Java class checks another message queue for a correct further processing of my SOAP request. This is done by a repeated lookup at the queue at…
-
Running external Python
hi, I am trying to run external Python (2.5) in SOA 6.1. The script works fine from command line. I have added Python.Home to Window>Preferences > Scripting > Python > C:\Python25 When trying to run script from SOA, test looks inactive and reports a message "Test was not ready and did not run" Here is the python script:…
-
Change global prereferences from command line
Scripted change of Global HTTP Authentication PropertiesHowdy folks, Please can anyone think of a way to change global preferences (specifically the Global HTTP Authentication Properties) via a script (i.e. non-interactively)? The sitution is: We have several related applications, each with its own SOATest suite (i.e.…
-
Serial Number Generator
How to generate a series of positive integers?Howdy folks, I'm writing soatest-cases for a set-of-webservices which implement a "logical conversation". I need to pass a unique conversationId (as a soap-header parameter) with each service request. At the moment I'm just choosing a random number between 1 and 10,000,000 for…
-
How Do I Use a Method Tool to Get Current Value of an Environment
Hi, How do I use a method tool to find out what's the current value for my variable HOST and change it based on a response from a server. For example, I have an Endpoint field http://${HOST}/service. When my SOAP Client hits this URL, the server tells me to go to a different HOST. I'd like to substitue the current HOST…
-
Getting name of current scenario that method tool is running in
I need the ability to get the name of the test suite/scenario that the current method tool is running in. For example Say I have a setup test that starts a timer for a scenario and stores it in the context. I then have a tear down test for that scenario that gets the timer from the context and returns the total…
-
Using Dates & Times
Hi, I'm having some difficulty using a Method to provide input to a Reqest via a Form XML window. I'm using the getTime() funciton that was posted on your forum as well as using examples from other folks: **** Code **** from java.util import * from java.text import * def getTime(): # Get an instance of the calendar…
-
Importing the random package in python 2.5
Group I am trying to import and use the Random module within Python and am having a hard time getting SOATest to properly use the python method that I have defined. The code is as follows CODE from com.parasoft.api import * from soaptest.api import * from java.util import * from java.lang import * from random import * def…
-
How do I access a XML data bank from a script
Can you give me some sample code for accessing a previously populated XML data bank in a script. Thanks.
-
How to get the response header in scripts?
How can get the response headers of the test in my pyton script? What Api to use? thanks Rama
-
Scripting - Where is the standard output stream directed?
If you are using the println method in a method tool then the standard output stream is directed to the console which is not shown in SOAtest when running normally. The console is shown however when using st.exe which shows the console in addition to the GUI. You would see the output in the console in this case. The…
-
How to access SOAtest Environment variable?
from Extension toolHow would one access defined variables in the Environments feature from within the Extension tool? I don't see anything that addresses this defined in the Scripting API...
-
How to Switch Transports
The first script changes all tests in the suite to HTTP 1.0 with close-connection. The second script changes all tests in the suite to HTTP 1.1 with keep-alive and chunking. Set to HTTP 1.0: CODEfrom java.lang import * from com.parasoft.api import * from com.parasoft.util import Util from webtool.messaging import * def…
-
Capture and Loop through the response
Hi, I have a query. A method returns 10 records. If there are more than 10 records then this method returns first 10 records.[Sorted by date/time creation] other wise it will return based on the number of records exists. There are 5 attributes in each record. Name is one of the attribute. The Name attributes is different…
-
Transient Test Suite Variables
Creating, Using, and SavingHi Everyone, A lot of this information can also be found in the Scripting API accessible via the Help Menu. The examples here involve variables that will be reset to the initial value of your choosing after each test run. These are available as far back as 4.5.1 SP2.0, although the GUI has…
-
read, modify, use and save number
I need to be able to read a number from a file, increment that number, use the incremented number in other data sources, and save that incremented number to the same file. In other words, I need an incrementor that is stored between test runs. Any ideas?
-
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,…
-
How to use the "Scripted XML" option
to generate XML within a SOAP ClientThe following example shows how to use the "Scripted XML" option within a SOAP Client to dynamically generate XML. To use this example: 1. Create a SOAP Client 2. Enter "http://soaptest.parasoft.com/calculator.wsdl" for the WSDL URI 3. Change the SOAP Envelope combo box to "Scripted XML"…
-
Scripting - Print to the Message window
how to?Hello, is it possible to print to the SOATest Message window using the Method tool? or other? Thanks!
-
Script to generate and return UUID
The script below invokes the SOAPUtil.generateUUID() method to return a string containing a univserally unique ID (UUID) CODE### Name: generateUUID ### Author: Mark Carlson ### Date: 09/15/2006 ### ### Description: Uses Parasoft API to generate universally unique ID (UUID) ### ### Usage: Returns string containing uuid ###…
-
Cannot access global properties from a script
Is it possible to access global properties such as database account information from a script? Mark
-
Dynamic data - scripting and auto
Is there a way to control the automatic generation of data for a field in a test case? How exactly does the "Auto" option work? I would like to randomize the end of a string example: user101, user205, user500 ... I don't want to list them manually in a table ... Also, I have a field which I would like to auto generate, but…
-
Simple JavaScript scripting example - Random Number
I have tried to make a JS-script, but I find it difficult, ref. FAQ Question 15 (p.414) in the User's Guide. 1) Is the description of this FAQ Question updated according to version 4.5 of SOAtest? I have problems to understand the explanation. 2) Is it possible to make a small example in JavaScript (there are few examples…
-
Scripting input field data
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…
-
Python Scripting to format data
Hey guys, I got this script for doing a format, but I get an error that I can't reconcile. The error states that The Method Takes only one Argument. I've looked for the ValueMap function in the API docs but can't find it. Does anything look out of the ordinary for this script? CODEdef formatPhoneNumber(input, context): #…
-
Write File tool for written record of tests
Hey guys I've been experimenting with the write file tool to keep a record of requests as a data export strategy. It's just easier to upload request/response data to my issue tracking software from an already written file instead of mme being a human database. Finding the test in my test suite clicking the traffice viewer,…
-
Scripting Example for SystemTime
Does any one have an example how to script or retrieve systemtime with JYTHON in SOA Test 4.1? -LeapTester
-
Scripting - random 11 digit number
I have a test for one operation which has one input parameter and it takes 11 digit number. Can you please provide me a testscript which generates any random 11 digit number for input field. Thanks LeapTester
-
Using regular expressions in jython methods
I would like to use python/jython regular expressions in a method. However, when I try to import re I get an errror ImportError: no module named re Here's a toy example: [CODE] import re def parseXMLElement(input): pre = re.search("<*?>", input) print pre Am I mistaken about the module to import? All the online examples of…
-
rounding in Python
rounding a returned value in PythonHi SoapTest, I have the nice little script written that will return a value that I will be using to compare to one of my results. I am having a problem, however, with length of the value. I need it to be only two digits after the decimal point. I can't seem to find a way to truncate in…
-
Python api documentation
Is there any documentation for the python libraries soaptest.api and com.parasoft.api?
-
Converting time stamp recived to different format
converting time stampsHi Parasoft, I have a method that when called returns date/time stamps as follows: 2004-06-26T12:21:11.0000000-04:00 I would like to use that date/time in an XML Databank but the format is not allowed by my system. Do you guys have a way that I can convert it to the following format:…