-
How to get the environment variable value using jython in soatest?
How to get the environment variable value using jython in soatest? I need to pass the Env Variables in the service request file with scripted option, How can I pass it? I have used the following option but get the NONE result. def getTestCdValue(input,context): testcd =…
-
Skip Special Character in Incoming Request
I have an instance where the incoming request will be a Hex string that is preceded with ">>>" and ends with "<<<" Ex: >>>1601 0200 <<< I wanted to know what is the best way for me to skip the three arrows preceding the hex string and after? I want to skip the first three arrows and just deal with the hex string in-between
-
Scripting - Test Case Timing - Sleep to delay / wait
Hey guys I think i'm running across some transaction timing issues with my test cases which may be causing some data corruption at my service endpoint. I've been toying around with the folder level test case logic features but I can't seem to get what I want. Is there a way to put a pause in top to bottom execution per…
-
How do I import modules for Extension Tool in Jython
Hello, I'm trying to import a module in Jython but I'm getting some errors. I first go to Windows > Preferences > PyDev > Interpreters > Jython Interpreters and add the jython.jar found in the installation URL: C:\Program Files\Parasoft\Test\9.10 for SOAtest &…
-
[Help] Access Data Repository Data Source from A Message Responder Script
Hi, I'm trying to access values inside of a data repository on a Message Responder script. I have "use data source" checkbox checked. Code Below: import com.parasoft.api.*;def messageResponderResponse(context) { String dataRepoVal = context.getValue("root Data 2","AccountNumber"); Application.showMessage("DEBUG VALUE: " +…
-
[HELP] Script not accessing data currently stored in Data Repo
Hi, I’m trying to get the existing value in my Data Repository in column soloAccountNumber to be displayed to the console. Instead of showing the value that’s already there, it always say the value is null. The goal is to check if the data repo has a value, if its null, return the the value generated from Data Generator…
-
How do I convert XML data into an excel.
I want to fetch data from XML and put it into an excel. My XML data is like: ABC 123 I want to convert these data in Excel in table format
-
Verify PDF Document is Created
I have an application that can created a PDF report of the data displayed on the screen. Is there some way for SOATest to verify that the report is created when the button is clicked? I only need to make sure that the PDF document is created. I don't need to examine the contents of the document. Would the Extension Tool…
-
Using Atomic Variables to Better Handle Updating During Concurrency
The following forum post goes into detail on creating scripts to better handle changing values during performance tests with multiple hits in parallel. We will do this with the use of Atomic variables and in the case of this forum post example, specifically AtomicLong. AtomicLongs and the other Atomic variables are part of…
-
Scripting Issue: Trying to get value in adjacent cell in Table Data Source
I have a script which is using a table data source within Virtualize. In that table there are two columns, num and ID. The value of num is extracted from the request via XML databank and is stored as a variable in the responder suite, titled key. Key = num I have another variable that stored the ID value in a variable…
-
How to add java project to classpath
Hi, I'm new to Parasoft and while exploring it i encountered the below line in [Extensibility and Scripting basics] : If your Java class is from a Java project in your Eclipse workspace, add the Java project to the classpath. Can anyone tell me how to add java project to classpath. And also when i select 'Scripted' option…
-
Groovy Scritping not allowed in Community Edition ?
Hello, While creating a response for a request in virtualiser , I saw an scripting and when clicked bydefault groovy language was selected and an editor appeared on my screen.But I couldn't type anything there ,is this feature only for paid license?If not then any tutorial on the correct approach to use it.
-
How to create a Custom Response using Scripting option in Parasoft?
Hi , I am new to Parasoft. I want knowledge on how to create a "Custome Response" using Scripting. I see the tool is having an option "Scripted" in the Response Tab--> Input Mode to generate a Response by writing code using Java or a Groovy or some other language mentioned. If someone can provide me a small example or a…
-
Any video related to how to use java code to read incoming request
Hello, Is there any video related to how to use a java code to read incoming request and produce a response according to it?
-
How can I get values from REST path and return it as a string in the response?
For example, I have somehost.com/restapi/v1/value1 and I want it to return value1. I set up REST URL Data Bank and set "Path - 0" to value1. In one of the attribute in the response, I use this Groovy script... import com.parasoft.api.*; boolean customAssertion(Object input, ScriptingContext context) { String value =…
-
Encode / Decode base64 with javascript?
Hi, I need to decode base64 encoded output of a rest service and compare the decoded result with a value from a database, but I don't know how. I understood that it is possible to decode with javascript, but how can this be done? This is the scenario: * JSON call to a REST service returns a encoded value. * I saved this…
-
Query related to concatenating a data bank value and text data bank value and passing it as a Url
My test structure is like that Test1- Rest api call with few query parameter.One query parameter contains a Url. I have collected all the values of query parameters in Rest Url Data bank Test2- Rest api call and response is a session key in text string format, which I have collected in text data bank Test3 - Rest api call…
-
Get Current time in Milliseconds
I am trying to generate a timestamp of the current time but in milliseconds. Is there a scripting option to do this, perhaps Extension tool, or is it possible to generate it via the Data Generator Tool?
-
Scripting Issue: Trying to get a particular value in a column
I have a script where I generate a key based on the request. This key is a value listed in the first column in a table, and the script should return the value of the corresponding value next to the key value. Ex: In column 1 my key is A and I need to return the value next to it BC. So far my script results in an error when…
-
Dynamically create proxies, record traffic, and create assets using the REST API
I was recently at a customer engagement and they had the following requirement: We would like to create proxies on the fly, record traffic, create the asset, then delete the proxy. Parasoft has a powerful REST API that can easily facilitate this. This script does the following 1. Creates a new Proxy in record mode 2. Grabs…
-
Using Extension Tool to capture the request code
I have an instance where I need to capture the incoming request, and find part of the code marked by an unique identifier and return it as my request for my responders. How can I code this effectively? Here is the code I have so far that I got from another application, but not sure if it works in Virtualize: function…
-
Scripting with a value in a XML Databank chained to Request
I am trying to access a value stored in a XML data bank that is chained to the incoming request. In my extension tool, I chained a XML data bank to see if I can successfully pass the value to the tool. my code: function f(input, context){ var id = context.getValue("Generated Data Source","traceId"); return id; } My issue…
-
Generate a Report from Persistent Violations for Static Analysis
When I run Static Analysis over my code base using Eclipse, any violations that pop up will be listed under Quality Tasks. Under the Configuration Running tab (or view), at the conclusion of the run, it states how many quality tasks were found, gives me the progress bar, and then at the bottom allows me to generate a…
-
Extract name of the data source with ScriptingContext
Hi, Im using the ScriptingContext in Parasoft SOATEST to build my request. I wanted to know how to extract the datasource **name ** in my script. The datasource type is an Excel file and Im using Java and need the name /path of the datasource. Appreciate the help. Thanks.
-
How to validate element value with group of elements?
I am getting rest service response in below format but i want to validate element value with my predefined data sources 1 Developer 5 Tester 7 Admin i have data source which have all roles allowed in my list ( Developer,Tester) now i want to validate all the roles from response against with my data source using parasoft…
-
Groovy REST Request - Scripted Input
When creating a REST request, I have three options for the data I send 1) Fixed, 2) Parameterized, and 3) Script I am attempting to use the script option to create a groovy script that will generate a random number each time I run a test. This is the script I have so far and I'm seeing the error "Argument count should be 0…
-
How to iterate to get column count and each column name from Datasource (DS as Table)
I was trying to write a piece of java code to loop thru each column and respective values. Using context i could see that i can read all the values (using context.getValues) of one column or can get one value using (context.getValue). However, I would need to know how do I read the coulmn count and their names ? So that i…
-
Can parasoft understand a java program which reads xml in java an convert it to string?
I have an XML file that contains only 2 parameters that can be parameterized - Country Code and Request. However I want to read the body in tag and convert it into text so that it can be used for correlation. Kinldy help.
-
How can I retrieve/use the project location in a relative path to open and read/write to a text file
I am using the following Jython script to read and then update a value from a text file on my local pc, but need to be able to use a relative path to identify the file in both line 7 and 14. I have verified my PROJECT_LOC variable is: "C:/Users//File/Path/To/Workspace/Project". Any help is appreciated. Works Locally but…
-
How to capture extension tool response as a file or Variable to use in further test steps.
package com.java;import com.parasoft.api.Application;import com.parasoft.api.ScriptingContext;import java.io.IOException;import java.util.ArrayList;import org.json.simple.JSONArray;import org.json.simple.JSONObject;//import org.openqa.selenium.firefox.FirefoxDriver;public class Test { public Object login(Object input,…
-
Combine two fields of SOAP response to One
I would like to combine two fields values of same SOAP response into One. So that I can assert the One filed of SOAP to REST response field. SOAP Response: Field 1 = date Field 2 = Time Combine SOAP field (1 &2) to Field 3. Assert SOAP Field 3 to REST response field. How should I do this?
-
How add an extension tool that respond requests?
Hi, is possible to me add a totally custom response, e.g pass the request to an extension script and let him to respond with a Json? I'm very confuse about how do this, i try to add a script in the message responder -> response (tab) but on this i only can manipulate context on script created in that way. I want to receive…
-
Is there any option/flag for the user to turn ON/OFF Regression/Diff Control for all tests at once
I want to turn ON/OFF (enable/disable) Regression/Diff Control for all my tests before starting my execution. Is there a place where i can control this setting?
-
Mongodb Connection Failure Replica Set
Hi Guys, I'm trying to connect mongo db with replica set with mongo db query tool but getting "Query couldn't resolve." While same working for normal mongo db without replica set.
-
How to capture response time?
While running the regression controls in SOA for each operation, we are giving some 100-200 inputs. And for each we can see the response time as well. Is there any default method, by which we can capture these response times per input and export them into an excel sheet.
-
SSH Connection
SSHDear All, I would appreciate it if you could share your knowledge regarding ssh connectivity: I am running a SOAP client in my suite (windows pc) and the server is running on a linux pc inside the network. I would like to connect to the linux (via soaTest) system, execute a command (for example "ls -la /home/lefteris")…
-
Lightweight Scripting of Datetime Fields in JSON Responder
Is there a simple way to programmatically alter certain values in an otherwise static JSON response payload with Virtualize? For example, let's say I've defined something like the following as a literal response in a JSON Message Responder: { "foo": "some static value for foo", "timestamp": "1970-01-01T00:00:00Z"} I'd like…
-
How do I parameterize XML
I'm brand new to SOATest, so this is probably a very basic question. The Rest service that I'm testing requires a unique name in the <name> field, so I'd like to use a date time stamp. At the moment, I have the following XML <service> <name>/registerService/update1</name> <description>service to let implementers to…
-
Configuring Class Path in CTP. or How to use java in CTP.
Hi Guys, I want to configure classpath in ctp to use java but unable to that. kindly help me.
-
Compare a set of elements of the JSON response to the standard set of elements
I have a JSON reponse with 152 currency codes fields. I need to compare the whole set of currency codes in the response with the standard set of codes. The issue is the currency codes in the JSON response are dynamic and they do not have a order, if they would have I would have added a string comparison and mapped to my…
-
Retrieval date format
Is there a way to validate the retrieval date format: yyyy-MM-dd'T'HH:mm:ssZ – Ex. 2017-06-26T01:00:
-
DB tool with extension tool
I am very new to SoaTest and was having difficulty utilizing the extension tool with the DB tool. I was wanting to access the results of a db tool query within the extension tool but was having difficulty doing so. The input object just shows "text" where if i attach the extension tool to a soap response, I will recieve…
-
How to Convert HTML to XML in SOAtest.
Hi Guys, Struggling to convert HTML to XML in SOAtest. Though I tried using XML Transformer with selecting mime type text/html but unable to convert. Any help would be appreciated. :smile:
-
Explicitly Passing any Test in SOAtest.
Hi Guys, As we have ****Context.Report()**** method to explicitly fail any scenario.Do we have any method to get it Passed or Success explicitly.
-
I want to add the amount and assert the total to a value
Hello, SOA test : 9.9.5 I have an API where the response will be the clients accounts details like(accounts name, Category, amount and etc). I want to add all the different accounts "amount" and assert the same with the "total balance" field. please advise. Thank you. regards, Neil
-
how to validate if response field is expected to return X and Y.
Hello , I want to assert on a a response field(string comparison assert) . But the response field value returns X and Y . Both values are Valid. I want my assertion to pass the test in both cases. I know we can assert on one expected value. can you please advise which assertion to use to validate the same field with two…
-
Iterate the datasource values
I have requirment to read a column - all the rows of an excel data source and send in my response. How to iterate over all the rows and fetch the value in the excel data source. Pl. help
-
How to read JSON response with JYTHON script.
Hello, I am trying to read JSON response via JYTHON script. h def assertresponse(input, context): value = String(input) #value = input.scannedDate() Application.showMessage(value) The above script will read complete response. 1)I want to know how I can read individual field in response and load the value into a variable.…
-
Workspace and project path from script
I need to access files saved to my workspace from Groovy script. How can I get the path to my workspace and project?
-
Copying files and directories in test setup
I'm a complete dummy in Java. I have service for which I need to setup a file directory structure in the test setup. I thought of using Groovy scripts to copy the files rather than creating batch files. It seems to be an easy task with Apache FileUtils but I can’t figure out how to use it in my Extension script. I tried to…