SoapUI Testrunner giving error about TestAssertionRegistry

徘徊边缘 提交于 2019-12-14 01:30:12

问题


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:

  1. Open your *-soapui-project.xml in a text editor.
  2. Substitute all occurrences of type="JsonPath Match" for type="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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!