Contributions
java.lang.NullPointerException at JUnitReportCollector.afterRun(JUnitReportCollector.java:129)
Hi guys, Sorry if I post it in the wrong spot and point me to the correct one if this is the case.. I developed a test case which creates other test cases from the spreadsheet and sporadically I can get the following error (see below) when soap UI is started and this test case executed straight after that (when it is loaded up). Is there any settings or workaround to resolve the issue? Thanks in advance. ERROR:java.lang.NullPointerException java.lang.NullPointerException at com.eviware.soapui.report.JUnitReportCollector.afterRun(JUnitReportCollector.java:129) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.notifyAfterRun(AbstractTestCaseRunner.java:301) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalFinally(AbstractTestCaseRunner.java:191) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalFinally(AbstractTestCaseRunner.java:43) at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:163) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)10 years agoPlace ReadyAPI QuestionsReadyAPI Questions849Views0likes1Comment- 10 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.1KViews0likes0Comments
[Res] addAssertion method returns null for AssertionTestStep
Hi there, I'm using soap UI Pro 4.6.1. and adding ProXPathContainsAssertion dynamically (or XPathContainsAssertion) to the AssertionTestStep by using the following code: def testStep = context.testCase.testSteps["NameOfTheStep"]; def assertion = testStep.addAssertion("XPath Match"); assertion.name = "NameForAssertion"; It fails with the java.lang.NullPointerException: Cannot set property 'name' on null object at the last statement. Hence the method of assertion creation (testStep.addAssertion) returns null. If I use the target test case of a different type (e.g. Http Test Request Step) then it works fine without any issues. I had once the assertion addition worked for me for the AssertionTestStep by incident and then it started to fail again. Can you please advise if there are any known issues with this method? Or maybe you can just check that unit-tests are not failing for this method? Should I add a new assertion in a different way for the Assertion Step compared to HttpTestRequest one? Full scenario to reproduce the problem is below. 1. Create a new test case 2. Add a new AssertionStep 3. Add a new Groovy Script step 4. In the Groovy Script do the following: a) get the reference to the previously created AssertionStep (via context.testCase.getTestStepAt(0)) b) try to add an assertion of XPath Match to the assertion step c) assert if the new assertion is not null - you can use log.info(assertion) which would show if assertion instance is NULL or has a value (in which case it will log the class name). In my case at the point 4c I'm getting an issue that assertion is NULL and I can't change any properties of the assertion instance. Please assist.10 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.5KViews0likes3CommentsRe: Can't create assertions for AssertionTestStep
Hi Rao, Thanks for the response however what is the point to provide you with the XPath value if I can't access the assertion instance after its creation. This script is sufficient to reproduce the issue (if it can be reproduced in your environment). If it doesn't happen for you then it means that the issue has been fixed and I need to upgrade my soap UI to a new version. But if this is the case then please let me know in which particular version/build it has been fixed because sometimes it was painful for me to upgrade soap UI as we use numerous integrations with other third party libraries. Full scenario to reproduce the problem is below. 1. Create a new test case 2. Add a new AssertionStep 3. Add a new Groovy Script step 4. In the Groovy Script do the following: a) get the reference to the previously created AssertionStep (via context.testCase.getTestStepAt(0)) b) try to add an assertion of XPath Match to the assertion step c) assert if the new assertion is not null - you can use log.info(assertion) which would show if assertion instance is NULL or has a value (in which case it will log the class name). In my case at the point 4c I'm getting an issue that assertion is NULL and I can't change any properties of the assertion instance. Do you still need the complete script after this explanation? Do you want me to post it into the PRO forum as we are paid customers and need this problem to be resolved asap?10 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.9KViews0likes0CommentsCan't create assertions for AssertionTestStep
Hi there, I'm using soap UI Pro 4.6.1. and adding ProXPathContainsAssertion (or XPathContainsAssertion) to the AssertionTestStep by using the following code: def testStep = testCase.testSteps["NameOfTheStep"]; def assertion = testStep.addAssertion("XPath Match"); assertion.name = "NameForAssertion"; It fails with the java.lang.NullPointerException: Cannot set property 'name' on null object. It tells me that the method of assertion creation (addAssertion) returns null. If I use the target test case of a different type (e.g. Http Test Request Step) then it works fine without any issues. I had once the assertion addition worked for me for the AssertionTestStep by incident and then it started to fail again. Can you please advise if there are any known issues with this step? Is there an issue in the 4.6.1. version?10 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.5KViews0likes4Comments- 768Views0likes0Comments
Re: easy way to include assertions in reports?
Hi there, I'm also new in soap UI. So don't take my post too serious. My understanding is that we need to add another sub-report type and (probably) implement new data source type (similar like PropertyReport does) then this sub-report can be included into another report. However it would be good to have the report included into the soap UI pro installation package. Or at least some implementation sample for it from eviware experts. So far I found 'JasperReports Tutorial' in the google which I believe provides general idea how to do it. However I'm not sure if it is applicable to the soap UI. This is code example to get assertions for 1 request step: def testStep = testRunner.getTestCase().getTestStepByName("Test Request") def list = new ArrayList() def count = 0 for(assertion in testStep.getAssertionList()) { count++ def item = 'Assertion #' + count + '. ' + assertion.getName() list.add(item) def assertionErrors = assertion.getErrors() if (assertionErrors == null) log.info('Successful') else for (error in assertionErrors) { def errorItem = 'Error: ' + error.getMessage() list.add(errorItem) } } for (l in list) log.info(l)519Views1like0Comments