Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Help with Response validation using DataSource

LegacyForum
LegacyForum Posts: 1,664 ✭✭
edited December 2016 in SOAtest
Regression controls not picking the latest values...
Using Response Validation Wizard I created 'Regression Controls' for specific elements
within the SOAP response.

Set up the Datasource (Table) with Column names matching the Response elements and expected
data values.

Is the data statically bound to the regression control ?
Each time a test is run, it DOES NOT seem to pick the latest values from the DataSource, as I changed
the expected data items in the DataSource.

Any clarification would help.

Question 2: I deleted the 'Traffic Viewer" from a test, how to enable it so that I can see the traffic.
-Thanks,

RRedy.
Tagged:

Comments

  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Hello RRedy,

    In order to help you with your first question, I'm going to need to know more about what you are trying to accomplish.

    The Response Validation Wizard does not link the Regression Control to a Data Source. Have you changed the Regression Control to use the Data Source as the Regression Control Source?

    If this is still unclear, the Documentation contains a lot of information on Regression Controls and the Diff tool. I would be happy to clarify any that is not clear in the Documentation.


    To add the Traffic Viewer back, Right Click on the test. Select Add Output. Select Traffic Object, then select Traffic Viewer. Click Finish. Now the Traffic View should be back.


    Joe
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭

    Hello RRedy,

    In order to help you with your first question, I'm going to need to know more about what you are trying to accomplish.

    The Response Validation Wizard does not link the Regression Control to a Data Source. Have you changed the Regression Control to use the Data Source as the Regression Control Source?

    If this is still unclear, the Documentation contains a lot of information on Regression Controls and the Diff tool. I would be happy to clarify any that is not clear in the Documentation.


    To add the Traffic Viewer back, Right Click on the test. Select Add Output. Select Traffic Object, then select Traffic Viewer. Click Finish. Now the Traffic View should be back.


    Joe

    Hi Machado,
    Appreciate your time. I pretty much followed "Manually Creating Regression Control" topic and the popup menu
    option "Add Output" brings up for the selected WSDL operation test, a dialog box with Response, Request, Both
    layout. I chose the "SOAP Envelope -> and 'Diff' tool". Since I already set up a "Table" type DataSource for this test
    suite, I mapped the "Data Source Control" to the column name in the Table I set up.

    Diff Mode should be set to "Text", right ?
    In the "Options" panel, checked <Ignore White Spaces> box.

    The first column in the Datatable is tied to the "Form Input" for the SOAP request param.
    The second column in the DataTable is tied to one of the SOAP Response elements with matching name.

    When I run the test, the Response from the Web Service shows correct data for the given input the test
    has picked from the DataTable. However, the element in the SOAP response should be macthed against the
    value given in the DataTable, which has the correct value, but it fails the test.

    Any ideas ?
    -thanks,
    RReddy.

  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    I think I understand what you are tying to do now.

    Instead of doing manual Regression Control, go ahead and do the automatic Regression Control.

    Once the Regression Control is generated, select it, then go to the Form XML tab.
    For each parameter that you want tied to the data source, change it to Parameterized and select the proper data column.

    Joe
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭

    I think I understand what you are tying to do now.

    Instead of doing manual Regression Control, go ahead and do the automatic Regression Control.

    Once the Regression Control is generated, select it, then go to the Form XML tab.
    For each parameter that you want tied to the data source, change it to Parameterized and select the proper data column.

    Joe

    All right Joe, For a given test, I did the following:
    1- Created Regression control as Right Click on the individual Test Node,
    -> choose < Update Regression Control -> Multiple Controls -> Remove Exisiting Controls >
    2- Click on the < Diff control under the Test Case and choose "DIFF Mode as XML from drop down box,
    and choose 'SOAP Response' tab.

    3- Assigned DataSource parameterized columns to a few selected elements of the Response to
    compare for expected values. (wanted to verify part of the Response elements )

    4- For the other elements that I am NOT interested to compare the expected values, the check box
    <NIL> next to that element is NOT selected and chose "FIXED" from the drop down box.
    (Please explain what 'NIL' means in this context ??)

    4- Already Set up 2 rows with values in DataSource, and 1 row has correct expected value and the other
    has incorrect expected value.

    5- Expected the SOATest to show me 1 Failed and the other Successful.
    6- What is shown in the Test Result pane is as follows:
    For Row 1>>
    Row PaxIdList_Table (row 1) - Inserted element "Header" to XPath /Envelope

    Row PaxIdList_Table (row 1) - Inserted text content "10203040333" to
    XPath /Envelope/Body/lookupPassengerByIdResponse/return/Id

    Row PaxIdList_Table (row 1) - Inserted text content "75044" to
    XPath /Envelope/Body/lookupPassengerByIdResponse/return/Zip

    Row PaxIdList_Table (row 1) - Inserted text content "Garland" to
    XPath /Envelope/Body/lookupPassengerByIdResponse/return/City

    Row PaxIdList_Table (row 1) - Inserted text content "USA" to
    XPath /Envelope/Body/lookupPassengerByIdResponse/return/Country

    for Row 2: >> this one is supposed to fail as I intentionally set up incorrect value
    in the Data Source.
    Row PaxIdList_Table (row 2) - Changed element text content value from the expected "VA" to "IL" in
    XPath /Envelope/Body/lookupPassengerByIdResponse/return/State/self::node()[1]

    Row PaxIdList_Table (row 2) - Inserted element "Header" to XPath /Envelope

    Row PaxIdList_Table (row 2) - Inserted text content "10203040222" to
    XPath /Envelope/Body/lookupPassengerByIdResponse/return/Id

    Row PaxIdList_Table (row 2) - Inserted text content "75044" to
    XPath /Envelope/Body/lookupPassengerByIdResponse/return/Zip

    Row PaxIdList_Table (row 2) - Inserted text content "Chicago" to
    XPath /Envelope/Body/lookupPassengerByIdResponse/return/City

    Row PaxIdList_Table (row 2) - Inserted text content "USA" to
    XPath /Envelope/Body/lookupPassengerByIdResponse/return/Country

    Please explain me, why SOAtest is showing all these "XPath stuff for each element ?

    Just for info I show the actual SOAP Request/Response for the 2nd Row:
    POST /DepartureControlService/DepartureControl HTTP/1.0
    Host: 162.36.234.86:7001
    Content-Type: text/xml; charset=UTF-8
    Content-Length: 375
    SOAPAction: ""

    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/&quot;
    xmlns:xsd="http://www.w3.org/2001/XMLSchema&quot;
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
    <SOAP-ENV:Body>
    <lookupPassengerById xmlns="http://services"&gt;
    <cbpId>10203040333</cbpId>
    </lookupPassengerById>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    RESPOSNE:

    HTTP/1.1 200 OK
    Connection: close
    Date: Fri, 20 Jul 2007 18:31:03 GMT
    Content-Type: text/xml; charset="utf-8"
    SOAPAction: ""
    X-Powered-By: Servlet/2.4 JSP/2.0

    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;
    <soapenv:Header/>
    <soapenv:Body>
    <m:lookupPassengerByIdResponse
    xmlns:m="http://services"&gt;
    <m:return>
    <java:City
    xmlns:java="java:model">Garland</java:City>
    <java:FirstName
    xmlns:java="java:model">George</java:FirstName>
    <java:Id
    xmlns:java="java:model">10203040333</java:Id>
    <java:LastName
    xmlns:java="java:model">Bush</java:LastName>
    <java:State
    xmlns:java="java:model">TX</java:State>
    <java:Zip
    xmlns:java="java:model">75044</java:Zip>
    <java:Country xmlns:java="java:model">USA</java:Country>
    </m:return>
    </m:lookupPassengerByIdResponse>
    </soapenv:Body>
    </soapenv:Envelope>


    A - Could you also explain what is the difference between "Response Validation Wizard" and "Setting up
    a Regression Control" for a given TEST.

    B - Before I re-run the same test, If I change the values in the DataSource, what action should I invoke,
    as to 'refresh' the Control to pick up the latest values. Is it "Update Regression Control" popup
    menu option on the selected Test Node ?

    -thanks for your time again, I need to be testing more of the SOAtest functionality as part of this evaluation
    and I sincerely thank you for your support.
    -RReddy.
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    RRedy,

    You should be using the "Form XML" tab, not the "SOAP Response" tab. In the "Form XML" tab is where you should be setting the parameterized values.

    Basically, using Create(or Update) Regression Control creates a Diff for the whole response based on the actual response received when the test ran, while the Validation Wizard lets chose different validations(one of which is to create/update the Regression Controls). More detail on this can be found in the documentation. You can use either one to setup the initial Diff tool(s), but you will still need to go in and parameterize the values.

    Once the Diff tool is correctly pointing to the data source, you will not have to update it. It will check the data source every time.


    Joe
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Hi RReddy,


    If you are in the middle of an evaluation, then we are able to assign a member of Professional Services to assist you with your technical issues in more direct ways than via the forum. You can contact your sales representative to be assigned a Professional Services team member. I think this will be the best way to optimize your time during your limited evaluation period.


    Sincerely,
    Jason
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭

    RRedy,

    You should be using the "Form XML" tab, not the "SOAP Response" tab. In the "Form XML" tab is where you should be setting the parameterized values.

    Basically, using Create(or Update) Regression Control creates a Diff for the whole response based on the actual response received when the test ran, while the Validation Wizard lets chose different validations(one of which is to create/update the Regression Controls). More detail on this can be found in the documentation. You can use either one to setup the initial Diff tool(s), but you will still need to go in and parameterize the values.

    Once the Diff tool is correctly pointing to the data source, you will not have to update it. It will check the data source every time.


    Joe

    Hi Joe,
    Well I tried that. My DataSource 1st column is assigned for SOAP Request Parameter. That works fine,
    as the SOATest tool picks up the value. However having problems with "diff"ing the response
    against the values in the DataSource.

    Question: Is it possible to test for partial response, i.e, my SOAP response contains the follwoing:

    HTTP/1.1 200 OK
    Connection: close
    Date: Fri, 20 Jul 2007 20:30:44 GMT
    Content-Type: text/xml; charset="utf-8"
    SOAPAction: ""
    X-Powered-By: Servlet/2.4 JSP/2.0

    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;
    <soapenv:Header/>
    <soapenv:Body>
    <m:lookupPassengerByIdResponse
    xmlns:m="http://services"&gt;
    <m:return>
    <java:City
    xmlns:java="java:model">Garland</java:City>
    <java:FirstName
    xmlns:java="java:model">George</java:FirstName>
    <java:Id
    xmlns:java="java:model">10203040333</java:Id>
    <java:LastName
    xmlns:java="java:model">Bush</java:LastName>
    <java:State
    xmlns:java="java:model">TX</java:State>
    <java:Zip
    xmlns:java="java:model">75044</java:Zip>
    <java:Country xmlns:java="java:model">USA</java:Country>
    </m:return>
    </m:lookupPassengerByIdResponse>
    </soapenv:Body>
    </soapenv:Envelope>

    And, I would like to test for a few selected elements of the Body, such as FirstName, LastName, State.

    I just called my Sales Rep, Tim Ngo, to get assigned a tech rep for this eval, and could not get thru.

    -thanks,
    RReddy.






  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭

    If you want to test only those elements, use the Response Validation Wizard to setup a Diff for each element of the response that you want to test. Then for each Diff, change the Regression Control Source.

    Joe
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    As an alternative, you can use a single Diff tool, but run the test to make it fail. Then, you can right-click on the error messages and choose Ignore XPath. Now, your Diff tool will only check the XPaths that you have not ignored. This is covered extensively in the Tutorial under Help->Tutorial.


    Please take a look at the Tutorial because it is a quick and useful introduction to a large number of features. You have been asking a lot of questions here over a period of a few days, and most of them could have answered by spending just 2 hours working through the tutorial. I think you will find the tutorial to be a much more efficient use of your time.


    By the way, we recently switched our phone system, and we all have new extensions. This may be why you had difficulty reaching Tim. Please try calling our main line, which you can find on our public website at the bottom of the page. I have notified Tim to be ready for your call.


    Sincerely,
    Jason

Tagged