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.

How to call 1 of the SOAP Request Parameter in Groovy Script

Teja
Teja Posts: 10

Hi Team,

I am trying to perform the Custom Assertion by using below code with Extension tool by keeping it as a separate Teststep

import com.parasoft.api.*;
public class Comparison
{
//Compares a value from a database data source to a value returned in a SOAP response
public boolean compareToDatabase(Object input, ScriptingContext context) throws com.parasoft.data.DataSourceException
{
//Gets values from database data source named "Books"
String value = context.getValue("Books", "Book");
//Prints database data source values along with SOAP response values in a message to the console
Application.showMessage("Value from database is " + value + ".\nValue from SOAP response is " + input.toString() + ".");

//Verifies that the SOAP response value contains the database data source value
return input.toString().contains(value);
}
}

In the above code its Taking the Datasource successfully but i am not able to call the 1 of the SOAP Request Parameter Stored in XML Databank to validate it against the DB data

Answers