Forum Discussion
TanyaYatskovska
SmartBear Alumni (Retired)
Hi harry,
As far as I understand, this is the problematic part of the code that throws the error:
// MarketContext
Element marketcontext = doc.createElement("ns3:marketContext");
marketcontext.appendChild(doc.createTextNode(callTC.getPropertyValue("MARKETCONTEXT_1")));
eiMarketContext.appendChild(marketcontext);
I think it's better to check if the getPropertyValue doesn't return null and assign it to the node only after that. Does it make sense?
harry
4 years agoContributor
when i print the log statement for the property
callTC.getPropertyValue("MARKETCONTEXT_1")
its returning empty. But some how its its returning null pointer.
- TanyaYatskovska4 years agoSmartBear Alumni (Retired)
Hi harry,
I'm not a groovy expert. My first expectation would be to check if the object isn't null. something like:
if (obj!null) ' do something
or use try/catch.
- sonya_m4 years agoSmartBear Alumni (Retired)
- harry4 years agoContributorI didn’t find any solution. My scenario of the test case is to send empty value for the node.
Eg: <marketContext/>
Or
<marketContext></marketContext>
Because when node value is not sent we are suppose to get different error exceptionmessage. When node is not passed in the xml we get different error exception message. But everyone is suggesting here not to pass null or empty node . That is not the solution to my problem.
Related Content
- 4 years agokiranka
- 13 years agojitendra_1
Recent Discussions
SFTP
Solved4 days agotowardsQuality