Forum Discussion

abar's avatar
abar
Occasional Contributor
4 years ago
Solved

Unable to disable properties step

Hello

 

I have created a test suite with a test case where i have included a properties step along with a rest request that depends on the properties set in the properties step. The first time i run the test case the property is correctly set and all the steps in the test case succeed.

 

If i now disable the properties step, the test case still succeeds because for some reasons the properties are still set even though i have disabled the properties step. If i now change the property in the disabled properties step, the rest of the steps will be executed with the new value even if the property step is still disabled. Is this a bug or a missing something. Thank you

 

 

18 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Which version of SoapUI are you using?
    Would you try deleting the properties test step? (have backup of the project before trying)
    • abar's avatar
      abar
      Occasional Contributor

      I have tried deleting and recreating the properties step as well as starting a new project from scratch. The behaviour is always the same. My expectation would be that by disabling the properties step should be enough to make the depending steps fail but unfortunatelly this is not happening.

       

      I am using 

       

      Thank you for your help

       

      • nmrao's avatar
        nmrao
        Champion Level 3
        Are you sure disabling properties works? Tried in any of previous versions?

        Would you please show how your are using the properties with a screen shot in the request?
  • abar ,

     

    You will get values from Properties Step, No matter it is disable or enabled because properties step never gets executed. It is there for storing and retrieving values

     

    To overcome this what you can do is write a small code which will blank the property value after successful run.

     

    context.testCase.getTestStepByName("Properties").setPropertyValue("VARIABLE","")

     

    add this line into script assertion hope it will solve your issue.

     

    • richie's avatar
      richie
      Community Hero
      Hey HimanshuTayal,

      Im interested in this point too. Im struggling to visualise how you would automate this test to execute multiple times by nulling out the Properties step's property value after a particular run.
      Sorry if im being thick and just not getting it!

      Nice one,

      Rich
      • HimanshuTayal's avatar
        HimanshuTayal
        Community Hero

        richie :

         

        To achieve this particular scenario what you can do is :

         

        Suppose you want to null the properties test step value(s) if you get desired value in response.

         

        add a script assertion in particular Test Step and write below logic:

         

        if( response.contains("desired value") ){

             context.testCase.getTestStepByName("Properties Test Step Name").setPropertyValue("PropertyName1","");

             context.testCase.getTestStepByName("Properties Test Step Name").setPropertyValue("PropertyName2","");

             context.testCase.getTestStepByName("Properties Test Step Name").setPropertyValue("PropertyName_N","");

        }

         

        so what above logic will do, it will blank desired value at desired point of run