Hi Guys i am new to API automation in SoapUI. i want to know if it is possible to compare data received from the JDBC step against the Json Response. Currently how i am doing is, defining the xpath for each tag and saving values in variables and comparing them. is there a way to automate this in a generic way without defining xpaths for each element in xmls
Related
I am getting timestamp (2021-10-12T00:00:30.0+05:00) as a field in XML request body, which I need to validate whether it adheres to a specific format (yyyy-MM-ddTHH:mm:ss.fzzz) or not and return error if it does not pass the validation.
I tried using APIM expressions, but it does not allow using DateTime.TryParseExact(), a C# method. If anyone has any pointers, please let me know how can we achieve this?
After further reading the documentation , found out that there is no direct way to check if the timestamp matches the given the format. So went ahead with the regex matching to achieve it.
I used the below mentioned regex
^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(\.\d+)(([+-]\d\d:\d\d)|Z)$
I have request as below:
somehost:port/sometext?type={{type}}
I want to replace the {{type}} by three different values.
How do I implement it using postman scripts.
you need to use postman runner with a data (csv or json) file with the values of "type", and in runner select collection, then the data file and enter the iterations as required.
Refer the documentation
How to access a connector / Data Base from the initial/instantiation Form/Page?
Hi every body, any help will be appreciated.
I try to access using the API Rest, but the method need the activyty/task id or the instance flow id.
This is because the connector stores its result in a proces/local/Busines data model or Variables,
but in the initial form I don't have an
instance of the flow/task/activity and I can't access to the variable that stores the value.
I need to use the connector to access data base and to the Ldap
to get some values to show in the initial form before instantiating the process.
Is there any way to call a Groovy Script from initial Form?, if there is,
I can access from that script to the data base, and save this value into a form variable, to show it in the form I think.
P.S.: I use Bonita 7.2
thanks!
Sounds like you have a chicken and egg problem.
Can you instantiate the process with minimal data, then use a connector out to populate the BDM with the connector data, and then make the first step of your process the "initial" form? At that point you then have the case, taskid, etc.
If the data is not task/case specific, you can access the BDM data via the REST API and a custom query - i.e. you're not just limited to the API's that require the case/task/instance, etc. However, you may need to get clever with how you isolate that record. For example, I have some global parameters that I keep in in the BDM, and access them within my form by requesting the first record in that table via the rest API:
I created a variable called "globals" of type "External API" with the following REST call that retrieves the record with persistenceId=1:
../API/bdm/businessData/com.company.model.GlobalParameters/1
In your case, you probably need to use a REST Api extensions. Basically, you can create a new REST Endpoint using Groovy script. There is a documentation available here: http://documentation.bonitasoft.com/rest-api-extensions-808
Cheers
I writing a node.js application using rethinkdb as a backend.
To retrieve a json value you can use:
r.table('users').get(1).run()
That method call will return the full json document, there is however a method that allows you to specify the attributes to retrieve e.g:
r.table('users').get(1).pick('firstName', 'lastName').run()
I want to make use of this functionality and I have the attributes I want to 'pick' stored in an array. I can't seem to figure out a way to convert this array to a parameter list for the .pick method.
Please advice.
Just use the native apply method to directly pass the arguments array:
r.table('users').get(1).pick.apply(this,yourArray).run()
further reading
I am using SOAPUI for web service testing. I would like to do xml parsing via groovy script Test Step. For one test case, I have to insert xml tag [like <Email>xyz#gmail.com</Email>] in SOAP Request.
I can set value to xml tag using holder.setNodeValue(Xpath, Value), Using the same function I try to insert xml tag in SOAP request like holder.setNodeValue(Xpath, "<Email>xyz#gmail.com</Email>"). But in SOAP request xml tag set as
"<Email>xyz#gmail.com</Email>"
Because of this problem SOAP request not recognize that xml tag, Hence the value not get reflect /update in response.
Please correct me If I am using this function wrongly. Awaiting response from anyone..
Well that is happening because you are calling setNodeValue method. This method will set the value of the node (which can be of the XML node format).
Ideally, what you should have done is if node already exists () then just grab that node using holder and set the value.
Or
xpath = "//level1/level2/email"
holder.setNodeValue(xpath, "xyz#gmail.com")
Or the simplest, add a empty property value in between the nodes.
<Name>Test</Name>
${Property#TestValue}
<Phone>123123</Phone>
Now say if you want to add email between name & phone, assign some value to that property variable.
And if not, then leave it empty.