Forum Discussion

agiletestware's avatar
agiletestware
Occasional Contributor
14 years ago

obtaining details for HTTP and JDBC test steps

Hello,
I currently obtain details about soap/rest tests like this

....
if (st instanceof com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep)
{
def r = st.testRequest;
for( rt in testRunner.results )
{
if (rt.testStep.name.equals(st.name))
{
endpoint = rt.getEndpoint();
xmlRS = rt.responseContent;
........

How can I obtain the following using groovy
1. 'raw' request for HTTP test step
2. 'xml' output/response for http test step
3. connection string and query for JDBC test step
4. xml response for the jdbc query

Thanks in advance

2 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi!

    You can get the raw request either from the TestStepResult for an HTTPTestRequestStep with

    rawRequest = new String( rt.rawRequestData() )
    xmlOutput = rt.requestContentAsXml

    for a JdbcTestStepResult you can use

    xmlResponse = rt.requestContentAsXml

    to get the XML version of the result.. to get the connection properties you need to go to the JdbcTestRequestStep itself:

    jdbcRequest = testRunner.testCase.testSteps["JDBC Request"]
    connectionString = jdbcRequest.connectionString
    query = jdbcRequest.query

    Hope this helps!

    regards,

    /Ole
    eviware.com