You are on page 1of 2

xmlns:ser="http://10.99.21.

89/data/catalogDetails/1SER3e6fb6d481094287ae67628c41
bd4a82"/>
${POST - LoginDevice ()#ResponseAsXml#declare namespace ns1='${Global_Settings (
)#Rest_EndPoint}/navi/authorization/device'; //ns1:Response[1]/ns1:deviceToken[1
]}
def response = context.expand( '${GET - GetContentDetails ()#ResponseAsXml#decla
re namespace ns1=\'http://10.99.21.89/data/catalogDetails/1SER3e6fb6d481094287ae
67628c41bd4a82\'; //ns1:Response[1]/ns1:albumName[1]}' )

def eventId = response.split("albumName>")[0].replaceAll("xmlns:ser=\"http://10.


99.21.89/data/catalogDetails/1SER3e6fb6d481094287ae67628c41bd4a82","").replaceAl
l("////","")

// JAVA CLASSES
import java.io.File;
import com.eviware.soapui.support.*;
import java.util.*;
import jxl.*;
import java.lang.*;
// VARIABLE TO HOLD THE DATA SHEET NAME
// sDataSheetName = "header-inputs.xls"

// TO CREATE VARIABLES TO HOLD THE RESQUEST VALUES


def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
def request = groovyUtils.getXmlHolder("deployCampaign_test#Request"
);

// DECLARING VARIABLES FOR GLOBAL PROPERTIES


def projectdir = context.expand('${#Global#PATH}');
Workbook workbook = Workbook.getWorkbook(new File("E:/xl-input/inputs.
xls"));
Sheet sheet = workbook.getSheet("Input");
rowcount = sheet.getRows();
colcount = sheet.getColumns();
// TO GET THE TEST CASE NAME
def testCase = testRunner.getTestCase();
Name = testCase.getName();
// CHECK WHETHER THE TESTCASE NAMES MATCH
for (tc_row in 1..rowcount)
{
Cell a1 = sheet.getCell(0,tc_row);
String s1 = a1.getContents();
// UISupport.showInfoMessage("${s1}")
if ( Name == s1 )
{
current_row = tc_row;
break;
}
}
// TO CHECK FOR THE HEADER TAGS
for (tc_column in 2..colcount-1)
{
Cell a2= sheet.getCell(tc_column-1,0);
String s2 = a2.getContents();
//UISupport.showInfoMessage("${s2}")
if (s2 != "" )
{
Cell a3= sheet.getCell(tc_column-1,current_row);
String s3 = a3.getContents();
//UISupport.showInfoMessage("${s3}")
tag = s3;
//SETS INPUT VALUES IN CORRESPONDING NODE
request.setNodeValue("//icom:" + s2, "${tag}");
request.updateProperty();
}
}
This might be what you're looking for.
I'm doing SOAP API's but the return is still XML.
I have a "Property Transfer" & "DataSink"
> The property Transfer will pull responses & send them to the DataSink
> The DataSink will send the values to Excel
DataSink Settings:
File: Is a template how you want the sheet to look. Can even be blank doc.
Out File: Is the file it writes to and is in the format of the template
Worksheet: Is the sheet the template uses
Start at Cell: Need I explain but be sure if you use a header in the template -
then start at A2

You might also like