New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use context variables for XPath in message extractor #266

Closed
gucce opened this Issue Jul 13, 2017 · 0 comments

Comments

Projects
None yet
2 participants
@gucce
Contributor

gucce commented Jul 13, 2017

Problem

In my test suite (Citrus 2.7.1, XML tests) I extract a variable using XPath. The problem is that I cannot use a test context variable for the XPath definition like this:

<variable name="XPathCorrId" value="/some/xpath/text()"/>
...
<receive endpoint="jmsEndpoint">
    <message>
        ...
    </message>
    <extract>
        <message path="${XPathCorrId}" variable="downloadCorrId"/>
    </extract>
</receive>

Citrus does not replace the text context variable ${XPathCorrId} with its content but tries to use it as is. This lets Citrus think ${XPathCorrId} is a JPath definitions, see log:

DEBUG athVariableExtractor| Reading JSON elements with JSONPath

It would be nice to be able to use variables for XPath definitions since sometimes you have the same XPath for different receive actions.

@christophd christophd added the READY label Jul 24, 2017

@christophd christophd added this to the v2.7.3 milestone Jul 24, 2017

@christophd christophd closed this in c84a994 Oct 5, 2017

@christophd christophd removed the READY label Oct 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment