Forum Discussion

Zhenya's avatar
Zhenya
New Contributor
12 years ago

Geb+Spock and statistic

Hello everyone,

I'm new in LoadUI and I'm looking for solutions in the two following issues:

1. I already have some tests which are writting on Geb+Spock using page object. Can I run something more difficult than one file using LoadUI? Can I execute my Spock specifications using groovy runner?
2. Is there a possibility to show statistic based on the time which every action in my geb test takes? Something like on the picture...
  • Hi Zhenya.

    Looks like you're using some really cool technologies (I am a big fan of Spock!).
    I am sure you can get this to work in LoadUI, but it will require you to learn a little more advanced stuff about LoadUI to do that.

    For one thing, you can definitely use the GebRunner with Spock within LoadUI. The first thing you'll need to do is to add the Spock jar and any dependencies it might have (which are not already provided by LoadUI) into the ext/ folder (inside your LoadUI directory). Notice that LoadUI still uses Groovy 1.8 so you'll need a slightly older version of Spock.

    Once you've done that, you should be able to run simple scenarios in LoadUI.

    If you want to create new statistics, have a look at this page:

    http://www.loadui.org/Developers-Corner ... -variables

    You might want to create your own LoadUI component to do this kind of thing. This is not very hard at all, especially when you can just start from any existing component (see the directory called script-components/ which contains all of the Groovy components that ship with LoadUI).

    This post (that I wrote myself) might also help you get started with writing LoadUI components:

    http://blog.smartbear.com/load-testing/ ... in-loadui/


    If you are a LoadUI Pro customer, please create an issue for any problems you might face while doing this, we will be happy to help you.

    Best regards,

    Renato
    SmartBear Software
  • Zhenya's avatar
    Zhenya
    New Contributor
    Hello Renato,

    Thank you a lot for so full and helpfull answer. Unfortunatelly, I've stuck with the first part: run geb tests using LoadUI. I've copied all needed jars (I hope so) in the ext folder, but I get the following error:

    "TriggerTimestamp","Status","Result","TimeTaken","Timestamp"
    "13:02:42:151","","org.codehaus.groovy.control.MultipleCompilationErrorsException:
    Script1.groovy: 7: unable to resolve class com.qa.clientconfig.ReportingSpecification
    @ line 7, column 1.
    import com.qa.clientconfig.ReportingSpecification;
    ^
    1 error
    ","376","13:02:42:152"


    What I'm doing: I'm writting tests for application using Geb+Spock in Eclipse. I'm writting them in page object and have several packages (for pages, specifications, configurations,etc.). My dream - is launch existing specifications in LoadUI and it imports everything needed from another packages itself. Is it possible? Or in LoadUI I can run only a one file/script without any references to other sources?
    In case with the error above, LoadUI might be can't find this class/file, because it's called "ReportingSpecification" and placed in the "com.qa.clientconfig" folder, but I have no idea how let him know where to search for this file and work with it.

    Thanks in advance for any ideas how I can realize my dream if it's possible.

    Evgeniy.