问题
I am able to run my test case successfully with valid assertions, but when running via testrunner, it starts off with these errors -
ERROR [TestAssertionRegistry] Missing assertion for type [JsonPath Match]
ERROR [TestAssertionRegistry] Missing assertion for type [JsonPath Match]
ERROR [TestAssertionRegistry] Missing assertion for type [JsonPath Match]
ERROR [TestAssertionRegistry] Missing assertion for type [JsonPath Match]
Where do these errors come from? I disabled all my test steps but to no avail. It appears to be coming form the project level looking at the xml. I am trying to figure out where it got generated from.
Any help would be appreciated.
回答1:
JsonPath Match is a feature in version 5.2.x of SoapUI. You are trying to open the project in version 4.x, and the project files are not downwards compatible.
I was facing the same problem as you: how do I remove all of them. Here is how I fake removed them:
- Open your
*-soapui-project.xml
in a text editor. - Substitute all occurrences of
type="JsonPath Match"
fortype="XPath Match" disabled="true"
. Spaces and double quotes are relevant!
Not pretty, but it works. Also, if you want to go back, just reverse the substitution.
回答2:
As a follow-up, if someone else is using the pro version of the api and have a pro client in which the project is set up, and are still getting this error, you can do this to get your assertion to work via the java api:
//register the json path content assertion before the project loads
TestAssertionRegistry.getInstance().addAssertion(new JsonPathContentAssertion.Factory());
//loads the project, test suites, etc.
WsdlProjectPro project = new WsdlProjectPro(projectPath);
I'm not sure if this is a bug or if I'm using the API incorrectly but it doesn't appear the pro assertions are loaded into that registry along with the free-version assertions.
来源:https://stackoverflow.com/questions/26388320/soapui-testrunner-giving-error-about-testassertionregistry