cancel
Showing results for 
Search instead for 
Did you mean: 

Test Run failed using TestNG in eclipse for SOAPUI JAVA Test Framework.

SOLVED
Highlighted
New Contributor

Test Run failed using TestNG in eclipse for SOAPUI JAVA Test Framework.

It seems it is getting error after it tries to execute the first test case only. Please suggest. As checked for the assert, it is working fine in the SOAPUI tool.

 

Here is the code to execute :

TestRunner runner = testCase.run(new PropertiesMap(), false);
Assert.assertEquals(Status.FINISHED, runner.getStatus());

 

Showing below error :

20:44:06,302 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Sending request: POST /Library/Addbook.php HTTP/1.1
20:44:06,481 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Receiving response: HTTP/1.1 200 OK
20:44:06,491 DEBUG [HttpClientSupport$SoapUIHttpClient] Connection can be kept alive for 5000 MILLISECONDS
FAILED: SoapTest
java.lang.AssertionError: expected [FINISHED] but found [FINISHED]
at org.testng.Assert.fail(Assert.java:97)
at org.testng.Assert.assertEqualsImpl(Assert.java:136)
at org.testng.Assert.assertEquals(Assert.java:118)
at org.testng.Assert.assertEquals(Assert.java:563)
at restRunner.SoapTest(restRunner.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:134)
at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:597)
at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:173)
at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46)
at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:816)
at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:146)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
at java.util.ArrayList.forEach(Unknown Source)
at org.testng.TestRunner.privateRun(TestRunner.java:766)
at org.testng.TestRunner.run(TestRunner.java:587)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:384)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:378)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:337)
at org.testng.SuiteRunner.run(SuiteRunner.java:286)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1187)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1109)
at org.testng.TestNG.runSuites(TestNG.java:1039)
at org.testng.TestNG.run(TestNG.java:1007)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)


===============================================
Default test
Tests run: 1, Failures: 1, Skips: 0
===============================================


===============================================
Default suite
Total tests run: 1, Passes: 0, Failures: 1, Skips: 0

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
New Contributor

Re: Test Run failed using TestNG in eclipse for SOAPUI JAVA Test Framework.

Hi @nmrao ,

 

My bad, I was executing wrong code :

Assert.assertEquals(Status.FINISHED,runner.getStatus());

 

Replaced with below code and its working fine now!!!

Assert.assertEquals(String.valueOf(Status.FINISHED),String.valueOf(runner.getStatus()));

 

Thanks.

View solution in original post

4 REPLIES 4
Highlighted
Community Hero

Re: Test Run failed using TestNG in eclipse for SOAPUI JAVA Test Framework.

What SoapUi version are you using?
How some one reproduce the issue?


Regards,
Rao.
Highlighted
New Contributor

Re: Test Run failed using TestNG in eclipse for SOAPUI JAVA Test Framework.

SOAPUI Version 5.5.0

eclipse-2020-03

Highlighted
Community Hero

Re: Test Run failed using TestNG in eclipse for SOAPUI JAVA Test Framework.

And answer #2 question is ?


Regards,
Rao.
Highlighted
New Contributor

Re: Test Run failed using TestNG in eclipse for SOAPUI JAVA Test Framework.

Hi @nmrao ,

 

My bad, I was executing wrong code :

Assert.assertEquals(Status.FINISHED,runner.getStatus());

 

Replaced with below code and its working fine now!!!

Assert.assertEquals(String.valueOf(Status.FINISHED),String.valueOf(runner.getStatus()));

 

Thanks.

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors