Forum Discussion
HimanshuTayal
6 years agoCommunity Hero
Try to change encoding for your Test Request to UTF-8, if still problem exists, please attach any screenshot.
- prasannav6 years agoNew Contributor
Hi, i have updated the request with utf-8 as you mentioned. Still it failed when i executed in Java.
In SOAUPUI.
Note:- i tried with both script assertion and contains assertion. both worked in soapui but not from java.
Above project was exported as .xml file and below java code is used to run the tests from .xml file.
PropertiesMap propertiesMap = new PropertiesMap();
// WsdlTestCase testcase = (WsdlTestCase)testSuiteName.gette
WsdlTestCase xTestCase = (WsdlTestCase) testSuite.getTestCaseByName(testCaseName);
WsdlTestCaseRunner testCaseRunner =(WsdlTestCaseRunner)xTestCase.run(propertiesMap,false);
String testCaseRunStatus = null;
testCaseRunStatus =testCaseRunner.getStatus().toString();
List<TestStepResult> testStepResults =testCaseRunner.getResults();logTestStepResults(testStepResults,reportInstance);
private void logTestStepResults(List<TestStepResult> testStepResults,Reports reportInstance)
{
for(TestStepResult testStepResult : testStepResults)
{
reportInstance.logInfo("Message", Arrays.toString(testStepResult.getMessages()),null);
reportInstance.logInfo("Status",testStepResult.getStatus().toString(),null);
if(testStepResult.getError() != null)
{
reportInstance.logFail("Error",testStepResult.getError().toString(),false,null);
}
else
{
reportInstance.logPass("Error","No Error recorded",false,null);
}
}And this is the result.
Related Content
- 2 years ago
- 2 years ago
- 11 months ago
- 8 years ago
Recent Discussions
- 2 days ago
- 2 days ago