Forum Discussion

SDutta's avatar
SDutta
Occasional Contributor
13 years ago

JBDC Reponse and Assertion on the no. of Rows Returned

Hi,

Can some one help me in one assertion.. I have a response for a JDBC request that I am sending...

<Results>
<ResultSet fetchSize="10">
<Row rowNumber="1">
<ACREATED>2013-06-02 13:00:24.0</ACREATED>
<AEXPIRATION>2013-07-02 13:00:24.0</AEXPIRATION>
<ACOUNT/>
<ADESCRIPTION>Wi-Fi MS Access Monthly</ADESCRIPTION>
<ARESOURCETYPEID>WIFI_Basic</ARESOURCETYPEID>
<APRODUCTID>MS_WIFI001R30D_MONTHLY_HW</APRODUCTID>
<ASTATE>OPEN</ASTATE>
<ASTATE>OPEN</ASTATE>
</Row>
</ResultSet>
</Results>


I want to assert the response to check if the rowNumber for the Row tag is 1 or More than 1.

1 Reply

  • Please follow these steps:

    - In you TestCase, create a new "Assertion Test Step" after your Request Test Step.
    - Choose the appropritate "Source" (your JDBC Request) and "Property" (Response).
    - Select "Property Content" as your assertion type, then choose "Message Content Assertion".
    - Click the "Add" button.
    - The popup that will come up allows you intuitively select which XML fields to validate (tick the checkbox for the tags you need to validate) and their Expected Values. Notice you can choose an operator to use in the drop-down list.

    Regards,

    Renato Athaydes
    SmartBear Software