How to call 1 of the SOAP Request Parameter in Groovy Script
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
-
See my reply to your earlier question: How to achieve TextDatabank data storing in Custom Writable Databank ??
You can reference Data Bank columns from a script using context.getValue("Generated Data Source", "columnName"); The data source name "Generated Data Source" is special, reserved for getting data bank values. The second argument is the name of the data bank column.
0