Class PropertiesAccessor

  • All Implemented Interfaces:

    @API(status = API.Status.EXPERIMENTAL, since = "5.6") 
    public final class PropertiesAccessor<TestElementClass extends TestElement, Schema extends BaseTestElementSchema>
    
                        

    Enables type-safe access to TestElement properties. For instance: testPlan.propsTestPlanClass.serializeThreadGroups // succeeds testPlan.props{ serializeThreadGroups } // succeeds httpSampler.propsTestPlanClass.serializeThreadGroups // fails as HTTP Sampler is not related to TestPlanClass httpSampler.props{ enabled } // succeeds since "enabled" property exists in the superclass of HTTP Sampler

    If you need configuring several properties, you might use element.props { ... } syntax:

    testPlan.props {
        it[serializeThreadGroups] = true
        it[enabled] = false
    }

    The same in Java would be testPlan.getProps().invoke((it, schema) -> { it.set(schema.getSerializeThreadGroups(), true); it.set(schema.getEnabled(), false); });