-
Data Repository - Accessing and updating from script?
Looking for some guidance please as I am new to Parasoft. I have searched this forum for every search I could think of and googled searches as well. I have a requirement to increment a counter that will be used in a virtual service. Each time I increment I want to save to new counter value back to the data repository,…
-
[HELP] Multiple Responses Responder Message ${ } Syntax Not working
Hi, I'm trying to use the multiple responses responder to send values from Data repo's and databanks using ${} syntax. Currently I just get ${variableName} in the response. See Screenshots below. Note: I've tried accessing multiple ways shown in the example…
-
[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…
-
com.parasoft.stub.ResponseObject@5ecba2b0
We have created virtual assets where we have capture xml action in data bank and forwarded it to endpoint based on action. When someone else is trying to use our virtual asset endpoint for testing , response that is captured in payload is com.parasoft.stub.ResponseObject@5ecba2b0 not sure what does this means
-
2 response for same request one web service and one MQ in same responder
Hi wanted to check can we have one responder giving 2 responses webservice call synch response from webservices and aysch MQ response for same request in Virtualize.
-
how to send different response wrt request for same service
Hi, I have a situation where i need to send different response for different request body but the service is same. for example: below service triggered on search page, after clicking add to cart, on product details page. https://imservices-qa1-usch01.corporate.ingrammicro.com:9043/ESProductSearchCA_v4_0 authentication…
-
Virtual Asset issue The schema of messages includes recursive type definition resulting in a cycle
Hi, While trying to create virtual asset from recording file, I am getting the following error: This happens because the response has some child element same as parent element. For example: { "items": [ { "id": "123", "items": [] } ]} Due to this, I am getting truncated response which does not match the actual recorded…
-
Virtualize for performance testing of simulators
Can Parasoft Virtualize handle high volume of requests for performance testing Can Parasoft Virtualize right from long term maintenance perspective where we are thinking of hundreds of simulators for performance testing env
-
How to send same response for multiple request.
Hi team, i have a situation where my request parameter in a req body might be different. it's like someone can send 2 parameter or more. so i need a way to send a valid response each time for every request. is there any way for this. Please let me know if you need more details. Thanks Nihar Ranjan Arisal
-
Trying to use a file on CTP server
I am trying to use a CSV file for the CSV data source. I have uploaded the file to a folder on the server via the CTP, but I am unable to retrieve the file in the File Path: location / space within the CSV data source window. What is the format used to point to a specific file on the server? I am connected to the server,…
-
How to activate a Community Edition License.
Description: How to activate a Community Edition License. Solution: 1) Navigate to your Preferences or Click here to edit license preferences 2a) If you Navigated to Parasoft-> Preferences you need to navigate to the license page 2b) If you Click on Activate License you should see the following window pop up 3) Once you…
-
Dynamic Data Element
Hi Everyone, We're building a new service and one of the requirement for this is to have a dynamic Data Element request looks like this: response should look like this: The bolded items per payload are always changing. pretty much that's the primary key being passed from the request. is there a way to do this in Parasoft…
-
Service virtualization
I just started with parasoft service virtualization and created my first virtual asset and proxy in server and linked asset with proxy, when i hit that proxy URL on browser i get my reponse but when i use it in Node project i get CORS error because response from parasoft proxy does not have response header values like…
-
How can we parameterize a dynamic URL parameter (not q Parameter)
Here is the path: /eosservices/SOHServices/api/v1/group/SOH/customers/id (dynamic value)/locations?q=customerNumberTypeCode==CDF;statementofHealthReportingLocationID==86A&limit=2 I want to parameterize the "ID" parameter which is going to be dynamic and unique.. i should be able to read the dynamic value from the incoming…
-
Need some help where dynamic values in request parameter
Hi Team, I need some help on below REST service. end point: imservices-qa1-usch01.corporate.ingrammicro.com:9043/ESProductSearchCA_vs2 Body:…
-
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.
-
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?
-
Virtualize: Multiple Responder stub: Configure failover
Hi, Currently I am involved in creating a static stub using Multiple Responders in Parasoft Virtualize. I wonder how I can configure a failover mechanism for sending a dedicated response message when the correlation settings do not match (e.g. a 404 fault). It is just like sending the default message in SOAPUI, when search…
-
Traversing through json elements using JsonOutput
Requirement: I need to read a json from a file, traverse through the JSON elements and modify multiple values. I am using JsonSlurper to parse the text and traverse through the elements and able to modify the values. My request json contains multiple json arrays and json objects and elements. Issue: I have 2 unique…
-
Writing console output to a file
I am using the command virtualizecli -startServer >virtualizelogs.txt to write the logs to a file. But after executing the call to the server/virtual asset, I don't see that file is getting updated with the Application.showMessage statements.
-
Is there a way to import JSONObject in Groovy
I need to convert string to json object using Groovy. But when I try to add the statement import org.json.simple.JSONObject I get the compiler error saying unable to resolve the class. Please provide some guidance.
-
Correlation / Extract Element Regardless of Order in the Request
Is it possible to do a responder correlation based on a particular element and its value, regardless of its position in the Request body? The case I am working with is where the user sends a request with the same elements, however the order randomizes each time. For example, if I am checking for the value of "Status" which…
-
Validate IDs and throw error if invalid ID.
Hi, I have a requirement where i need to validate IDs and throw error if invalid. I have created data source and added available IDs. I have created one request and assigned data source to it. I am passing two parameters in my responder. I tried to execute but i am not successful in throwing error. ex:- Created Data Source…
-
Returning only 500 Internal Service Error instead of 200 with response
Is there a way to set up my mock to only return a 500 error if we enter in a unique value correlated to this? For example right now we have our mock set up to look for "JORDANS_CATEGORY" and this would return a valid response (200) that is set up in our traffic file. Is there a way to return only a HTTP status code instead…
-
Can we throw custom http status code and message using groovy?
Hi, I am looking to see if i can use groovy code to handle custom error messages like below? There is a logic in my groovy code where it throws invalid date range if If my date is greater then 90 days. I don't have logic where it also change custom status code/message. I want to see if i can throw status code = 405 and…
-
Groovy script unable to establish Oracle DB Connection
Hi Team, When tested the Virtual Service in local host with the below Script in the Response tab ---> Input Mode: Scripted---> Language: Groovy getting below error in the when monitored the logs. Error Message: com.parasoft.api.UserMethodException: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver Please…
-
Help with Regular Expression Criteria
I have a MQ responder I am trying to move from one tool to Virtualize. This responder has two main types of criteria, one is in the form of regular expressions, and the other is just plain text. I need help on how to create the criteria to match with the responder / how to handle these responders with these criteria. An…
-
Custom status code is not showing and always shows 200 OK.
Hi, i have a scenario where i need to validate account ID and display error message as "Invalid account ID" if account ID is invalid. I am able to validate and display message but i am not able to display my custom status code as 400. It always shows 200 OK. Can you help me on what changes i need to make this work? Thank…
-
Show error message if date is null or greater then 7 days
Hi, I am new to parasoft and trying to understand my requirement. I have two scenarios where if date is null or greater then 7 days then it should show error message as:invalid dates. I can see my message if date is passed but not without. Can any one help me on this issue please? Below is my requirement flow:- Assets:-…
-
How can i customize status codes in parasoft
Hi, I want to display custom status code based on my response. i always gets status as 200 OK but i want to change on some conditions. ex: if passing date is greater then current date then display status = 400 and message = Bad Request. * Can i do this in parasoft? (Yes - how) or * Can i do this using groovy? (Yes - how)…
-
Can we implement validation rules using Parasoft?
Hi, I want to know if we can implement validation rules in Parasoft without writing code. ex: My response should look if my date > current date then i can throw some custom error messages in response? or do we have any Parasoft methods that can be used for this kind of work?
-
Return Status based on the response
Is there a way to return the status code based on the response from the Groovy script of Response tab.
-
DataRepository
How to insert data in data repository using groovy script through pva.
-
Virtual Service Response Scripting
Hi, I have wrote a Java code to generate a response, when tested in the Java Perspective in Parasoft tool code is executed without any errors got a valid output. When i loaded the same to the "Virtual Service" ---> Response section and tested in local Server getting below error. Could someone correct the code. Attached the…
-
How to update the CSV present in the Virtual Asset
In the 'Incoming Request -> Extension Tool' Groovy script, with the below statement I am able to update the CSV file which is present in my local machine. File file = new File('C:/Users/filepath/Thirdparty.csv') file.append(value+'\n') But with the below statement CSV file which is present in the Virtual Asset is not…
-
How to read the values/content from FILE datasource
How to read the values/content from FILE datasource and use in Response tab groovy scripting? I was able to successfully read the values from EXCEL datasource using the below step in Response tab Groovy script. variable = context.getValues("data source name", "column name") I tried to use the below steps to read the values…
-
Updating the embedded server Data Repository
If I am using a Data Repository using "Embedded Server" with previously recorded traffic, is there a way to update that repository with more data without doing another recording or one record at a time?
-
SSL Proxy Setup Error
Disclaimer: I have mistakenly posted the exact same question below a few days ago on the SOATest forum. But since we couldn't reach a solution as recommended by Benken I'm posting this here. Here's the link to our discussion so far: https://forums.parasoft.com/discussion/4687/virtualize-enable-ssl-proxy#latest Hey…
-
Virtualize Enable SSL Proxy
I developed an Android app that connects to a node.js server in the cloud, I've generated a self signed certificate and I have already tested the SSL connection between the app and the server, it works perfectly. Now I'd like to deploy a Virtualize proxy between them, I generated a keystore.p12 from my private key and…
-
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…
-
How to get the request url/parameter values in Response tab
Is there a way to get the request url/parameter values in the Response tab and perform validations using Groovy script. I am able to get the values and perform validations on the Responder correlation Custom tab.
-
Groovy script not working in Response Tab
I am trying to validate one of the field from request. Using Groovy script in the response tab for the validation of the request. import com.parasoft.api.CorrelationScriptingHookConstants. def correlateOperation( context) { requestUrl = context.get(CorrelationScriptingHookConstants.REQUEST.URL) return requestUrl; } With…
-
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…
-
Help with XPath Substring
I am trying to get a part of a string up to the point where there is a blank space in the string. However, Virtualize is saying that it does not recognize what the .indexOf() function is. Can someone guide me as to what could be the issue and how to get the sub-string properly in Virtualize? The XPath code is am trying to…
-
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…