Forum Discussion

Pat's avatar
Pat
Occasional Contributor
15 years ago

Accessing last execution results of testsuites and testcases run from the GUI

Hi,

I am currently integrating SoapUI with TestLink and have created custom actions to support this by extending soapui.

Some of these actions involve sending test results to the TestLink API via the SoapUI GUI, mainly in the TestSuite and TestCase context menus. I can access the results of the test runs if I run the suite through code but I am trying to find a way to access them after they were run from the GUI.

ex.:

1) I include a custom action and Groovy class in the appropriate soapui folders.
2) I manually run a testsuite or testcase a number of time until I am satisfied with the outcome.
3) Right-Click the object for which my tests were run and select my custom action to send the result to TestLink

Now in step #3 I want to retrieve the results of the last execution for the object, is there any way I can achieve this?

7 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Pat,

    I've added some methods for accessing the last testRunner from the corresponding desktop panel, this will be in the upcoming nightly build. So for a testsuite result you would do (abbreviated for readability):

    WsdlTestSuiteDesktopPanel panel = SoapUI.getDesktop().getDesktopPanel( testSuite );
    if( panel == null )
    {
        UISupport.showErrorMessage( "TestSuite window has been closed and results discarded" );
    }
    else
    {
        WsdlTestSuiteRunner runner = panel.getTestSuiteRunner();
        if( runner == null )
        {
            // show error that tests have not been run
        }
        else
        {
            // access results from runner and report to TestLink..
        }
    }


    Note that the result is available via the corresponding window (desktop panel), so as soon as that is closed, the results are discarded from memory (for minimizing memory usage).

    Corresponding methods exists for testcaserunner and projectrunner.

    Hope this helps!

    regards,

    /Ole
    eviware.com
  • Pat's avatar
    Pat
    Occasional Contributor
    This is really appreciated, I'll give it a shot and let you know how it goes.

    I've been using SoapUI and initiating others to it for the last two years and it is always well received, truly a must have tool.

    Keep up the good work!

    Pat
  • Pat's avatar
    Pat
    Occasional Contributor
    Hi Ole,

    I've downloaded the nightly build and tried the code snippet that you have provided but I cannot seem to get the DesktopPanel to be returned. Perhaps I misunderstood which window needs to remain opened.

    "SoapUI.getDesktop().getDesktopPanel( testSuite )"  returns null for me even with the testsuite editor left open after I ran a testsuite.

    Pat
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    hmm.. .and this is from within an action extension at the testSuite level?

    regards!

    /Ole
    eviware.com
  • Pat's avatar
    Pat
    Occasional Contributor
    Yes, I have other actions at the same level that are working as expected.

    Basically when I call the getDesktopPanel() method I provide the testsuite from which I executed the action as an argument but I can't get it to return anything.
  • Pat's avatar
    Pat
    Occasional Contributor
    Would it help If I provided you with some sample code of my extension?