Forum Discussion

MartinSpamer's avatar
MartinSpamer
Frequent Contributor
13 years ago

TestRequest Properties

Can anybody shed any light on How to access "TestRequest Properties"

Particularly the Endpoint and Resource (which is the Path from the Interface->Method)

These are not the Custom Properties which are easy to access, but the systems built in properties.

Does anybody have any ideas ?
  • I've found an Alternate approach when using a Scripted Assertion these can be accessed via messageExchange.


    String requestPath = messageExchange.getRestRequest().getPath()
    String requestEndpoint = messageExchange.getEndpoint()
  • MartinSpamer's avatar
    MartinSpamer
    Frequent Contributor
    A partial solution.


    def testStep = ...
    log.info testStep.properties['Endpoint'].value
    log.info testStep.properties['Resource'].value


    This works for Endpoint but oddly not for Resource.
  • MartinSpamer's avatar
    MartinSpamer
    Frequent Contributor
    I've found an Alternate approach when using a Scripted Assertion these can be accessed via messageExchange.


    String requestPath = messageExchange.getRestRequest().getPath()
    String requestEndpoint = messageExchange.getEndpoint()