Forum Discussion

kamahade's avatar
kamahade
Regular Contributor
14 years ago

BUG ? with property teststep label ?

Hello team,
I'm using soapUI Pro 4.0.0, Build dist-131-2011-06-14, Build Date 2011/06/14.

 for( testStep in testRunner.testCase.getTestStepList() ) {     
if( testStep instanceof WsdlPropertiesTestStep ) {
def stepname = testStep.getLabel();
log.info stepname;
props = testRunner.testCase.getTestStepByName(testStep.getLabel());


giving me teststep label along with number of properties. is this expected or BUG?

6 Replies

  • Hello,

    I've just tried this code (testStep.getLabel() and testStep.getName()) and it returns just test step name (nothing else).
    Can you please paste (or include screenshot of) your results ?

    Thanks!

    Vladimir
    SmartBear Software
  • kamahade's avatar
    kamahade
    Regular Contributor
    I think one should use : testStep.getName(); and NOT testStep.getLabel() !!

    Right ?
  • Hello,

    what I meant was to show screen with properties printed, I don't see that on attached image.
    But in any case, yes you can use getName() method.

    Regards,
    Vladimir
    SmartBear Software
  • kamahade's avatar
    kamahade
    Regular Contributor
    sorry, I think you misunderstood or I failed to explain.

    Let me try again....

    if you have a properties step by name : "TESTPROPERTIES" and lets say you have 5 properties in that step.

    when you print " teststep.getLabel()" , the output is "TESTPROPERTIES(5)" and I expect it should print "TESTPROPERTIES" .. please see "(5)" is the unexpected (or exepected?)
  • Hello!

    It's expected, and you are right regarding that you should use name instead of label (depending on what you want to achieve of course).

    To clarify, this code in a Groovy Script TestStep:
    log.info testRunner.testCase.getTestStepAt(0).label
    log.info testRunner.testCase.getTestStepAt(0).name


    ...will give this in the script console (when an empty Properties TestStep first in the TestCase):
    Thu Oct 13 08:53:48 CEST 2011:INFO:Properties (0)
    Thu Oct 13 08:53:48 CEST 2011:INFO:Properties


    Regards

    Henrik
    SmartBear Software