-
Question regarding the traversing behaviour of preceding axes when used with / and //
<div id="moe-osm-pusher" style="display: block !important; height: 0px;"> <div><p>A44</p></div></div><div id="x"> <p>A</p> <div> <div> <p>A11</p> </div> <div> <p>A12</p> <div> <p>A13</p> </div> <div> <p>A23</p> <div><p>A00</p></div> </div> </div> <div> <p>A22</p> </div> </div> </div> //div[p[contains(text(),'A23')]]//…
-
How to validate uniqueness of a field value in the JSON response.
Hello everyone, Can someone help me how to validate a field, if the value returned in response in unique and contains no duplication. E,g: In below JSON, id field occurs multiple times, I want to validate "id" is unique and it's not duplicated in the JSON response. { "merchantCategories": [{ "id": "0001", "description":…
-
How can I add value assertions for my JSON payload that has root element
I've simplified my actual JSON response from my traffic viewer to make this example easier. Let's say I want to add assertions to validate that the first number returned is 111 and the second number is 222 (they are strings). I added a JSON Assertor but the only element that shows up is "root", so I tried manually editing…
-
Failed to respond to incoming message using data source row correlation
I have a request i.e. "crn":"234567890123456","amount":"200","settlementDate":"20091224", and a responder using a data source correlation of several response. And the response is to send the responseCode by validating the "amount" [<250] or [>250]. When I send a request via a Parasoft Virtualize .pva file the event…
-
How to add loop in xpath?
In my scenario , I am getting different number of elements which depends upon data I am passing in request and I want specific set of element. I have added "IF" condition for the same and I am getting expected element and now I want to iterate this "IF" condition for this set of elements.
-
Browser Validation
I am trying to validate an application webpage in SOATest. This test needs to validate that a particular column in a table to empty. Unfortunately, SOATest will either pass the test when there is a value in the column or complain that the XPath locator in wrong. In an earlier test I validated that there was a value in the…
-
Xpath: How to search in all child elements with certain text (browser validation tool)
I have a number of p elements in a div and I want to find a certain text within all of them. For some reason I can't get it to work, it finds only the first p element. Does any one know what to use differently? Element property: I've tried both text and value here (with and without [1] ) Xpath:…
-
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…
-
SOATEST returning error when trying to update the Xpath with string functions
I was asserting on the below response against my database value which is supposed to be Response from the service for scoreDate: 2017-03-16T12:45:25-04:00 Database value for scoreDate: 2017-03-16 12:45:25 (Expected value) I am passing the List name as a parameter from my Datasource excel sheet('ExpectedIPList' column). So…
-
Xpath - Extract element based on other element in the JSON response
I have a JSON response with following structure which is dynamic. I want to extract the account balance to a data bank of specific person eg:John "Details" : [ { "AccountBalance" : "6793", "Person" : "John" }, { "AccountBalance" : "3646", "Person" : "Peter"
-
Data Source Correlation - Request Body
I am trying to use the Data Source Correlation Request body but the documentation in the help is limited and doesn't have any examples. Are there any examples on how I set up the xpath correctly for the JSON Request Body that the service is receiving? In my request I have three elements and I want to match on one of them…
-
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?
-
SoaTest supports Xpath 3.0?
Does SoaTest supports Xpath 3.0? I could see some xpath functions not accessible: op:date-greater-than($arg1 as xs:date, $arg2 as xs:date) as xs:boolean op:subtract-dates($arg1 as xs:date, $arg2 as xs:date) as xs:dayTimeDuration
-
how can I validate the field name? in parasoft SOA test
Hello, i want to add an assertion to check the field name is returned as per schema. para soft SOA test 9.9 e.g: "status" : { "serverStatusCode" : "401", "severity" : "ERROR", if I want to check field name "severity" is returned as expected. we have standard assertions to validate the field values , But to add check point…
-
how to parameter data bank x-path
Hello, I am trying to parameter data bank x-path from excel sheet. here is my scenario below is the x-path I have in my data bank. /root/item[1]/id[1]/text() Output item'1' will be picked up from the response. I want to parameter the Item[1] value with an excel sheet , so that I can control which item to pick up from the…
-
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 extract empty tag values into a data bank
Hello, tool: SOA test 9.9 PART 1 I am extracting a value to data data, sometime the data is expected to be empty. The data bank throws an exception that: No nodes found. I want to retrieve some value even though the value is empty. I tried to go into option of data bank and set extract empty value as 'a' - But it did'nt…
-
How to apply an x-path into an array.
below is the sample JSON response, I want to get the documentid whose "subcategory" : "Loans" only i tried below, didn't work out. //documents/documentId[subcategory="Loans"]/text() I want to apply a condition on subcategory field and retrieve only document id which satisfy the condition mentioned. { "documents" : [ {…
-
I want to truncate first few numbers in 16 digit number using xpath(databank)
Hello, I am using data bank to retrieve a value to use in subsequent test. But I want to truncate the value and need only last 4 digits of 16 digit value. This is the x-path /root/card[1]/value[1]/text() This is the result of x-path. 4506446460519412 when I press evaluate x-path , i should only get last 4 digits "9412" can…
-
SOATest: Use of datasource column names in the XPath editor
I have the below JSON response where I need to assert the statusCode for a particular name and this name is getting fetched from the 'name' column in the excel sheet used as a datasource. JSON response: [ { "clientTypeCode": "IP", "statusCode": "PEND", "statusName": "Pending Approval", "id": 0, "name": "test1" }, {…
-
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.…
-
How to Extract/Validate Dynamic Webpage Elements
Parasoft: How to Extract/Validate Dynamic Webpage Elements Description: In some applications, we may come across dynamic elements whose ids/xPaths change every time the web page reloads. This can become challenging to extract/validate such elements. Below are a few techniques used to handle dynamic elements. Solution:…
-
XPath syntax - ways to get/test XPath
Hello. I have setup some stubs and am mocking up some responses by using the XPath Function matching. However, I can not seem to find much documentation or examples on syntax for this. I can get a basic text="sometext" function to work properly but, I would like to find out how to properly syntax looking for blank text,…
-
Verify multiple siblings in a list
Verifying a list entry is presentI have looked at XML Assertors and XML Transformers in order to verify that an element appears in a list containing a particular description AND a particular id and a particular event. Value Occurrence XML Assertors let you validate a particular value is present one or more times, or not…
-
Minimum node occurance in the response
Is there any way to assert minimum occurrence count of a node in the response? I only want to check if certain element is present at least once in a sequence. Also, is there any way to change the order of the outputs in a given test? Thanks
-
Concatenating Xpath values
Hey guys is there a way to take the xpath values given from a xml-databank (say Test 1:z0 & Test 1: z1) and concatenate or join them together for later use. Or possibly as a script? I looked through the scriptingAPI for a join or concat function, but I didn't look too hard . Thanks in advance, LeapTester
-
XPath and Regular Expressions
XPATHHello board members, I need your help once more. I have an XML tag in my result structures that represents the "Date". The value of this tag changes every time a new request comes to my server process. I added the Xpath to my global properties. In particular my Xpath contains /Envelope/Body/SomeWhere/In/Time/Date/,…
-
XML Assertor - String Comparison
Hi, I want to test saving data and then verify that the saved data is returned in the xml reponse from a REST service call. The response xml looks something like this (except there is much more data than presented here): <?xml version="1.0" encoding="UTF-8"?> <response> <DataDictionary> <complexType state="3" uid="341"…
-
Stub deployment
Hi, I have created a stub which I will be using instead of the actual web service provider. I am trying to configure the stub to return a particular response, based on the value of a node attribute of the request. However, these conditions are not being evaluated and the stub returns None of the multiple responses XPath…
-
How do I insulate testers from XPaths and other implementation details
in web functional testsSOAtest has a collection of features that will insulate users from XPaths.* Recording and playback: Testing scenarios are created using recording and playback; the user just needs to record the actions they wish to test in the browser and SOAtest will create the XPaths necessary to identify elements…
-
Evaluating an XPath from a xhtml document
Hi I'm trying to use a XML data bank to extract an element from this XHTML web page: <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head><title /></head><body…
-
XPath and price filter
Hi all, There is any way to insert an price filter (like "/bookstore/book[price>35]/price") in the XPAth above? /*[local-name(.)="Envelope" and namespace-uri(.)="http://.../"] /*[local-name(.)="Body" and namespace-uri(.)="http://.../"] /*[local-name(.)="response" and namespace-uri(.)="http://..."] /*[local-name(.)="price"…
-
Auto Populating parametized attributes
We're using the populate to map large (and small) tests. I've not been able to find an Xpath that will auto-populate an attribute. e.g. We have an element to ship: <MyDt myattr="true">2008-03-11</MyDt> After a populate with the following fields: Record/MyDt/myattr Record/MyDtXL Record/MyDt The test will populate as…
-
Using XPath in Method
Hi, From my response traffic, I am extracting a section using XML transformer and storing it into a variable. Now I want to use that variable in another method and need to use XPATH to extract some attributes for certain calculations and verification. Example: my variable will have data like: <TEST1> <CO A ="12" B= "23"…