我正在比较soapUi(Groovy)中的两个xml,我想忽略一些标签(不仅仅是一个)
我在下面尝试了这个解决方案,但没有奏效:
def ExpectedString = 'Expected Xml'
def ResponseString ='XML SoapResponse to compare'
Diff diff = DiffBuilder.compare(ExpectedString)
.withTest(ResponseString)
.ignoreComments()
.ignoreWhitespace()
.checkForSimilar()
.withNodeFilter{node -> !node.getNodeName().equals('somerandomstuff')}
.withNodeMatcher(new DefaultNodeMatcher(new ByNameAndTextRecSelector(),
ElementSelectors.byNameAndText))
.build()
我的代码有问题吗?我收到此错误:
No signature of method: org.xmlunit.builder.DiffBuilder.withNodeFilter()
is applicable for argument types: (Script4$_run_closure2) values:
[Script4$_run_closure2@2ea2e326] Possible solutions:
withNodeFilter(org.xmlunit.util.Predicate)
谢谢 !