tilln / jmeter-iso8583

ISO8583 Plugin for JMeter
MIT License
62 stars 32 forks source link

Feature Request: Allow pasting XML message #44

Closed barspi closed 2 years ago

barspi commented 2 years ago

Quite often we have an XML representation of the message:

<isomsg>
    <field id="0" value="2200"/>
    <field id="2" value="5558889422188129" />
    <field id="3" value="000000"/>
...
</isomsg>

It's tedious to convert that into a current ISO8583 sample, field by field. It would be much easier to just paste it to a text area (only makes sense when using the XMLChannel/XMLPackager combo).

Bonus points if we can still use all the __${} jmeter expressions :-)

tilln commented 2 years ago

Thanks for suggesting this feature.

However, I'll have to look more closely into how this could be implemented as the plugin relies on JMeter components that are unfortunately not always easy to extend, such as TableEditor that has a private clipButton that handles pasted content from the clipboard by splitting it at line breaks and tab characters.

As a workaround you could therefore transform your xml message into lines of tab-separated columns that fit in the ISO8583 Sampler's message table fields, for example like so:

$ echo '    <field id="0" value="2200"/>
    <field id="2" value="5558889422188129" />
    <field id="3" value="000000"/>
' | sed -e 's/\s*<field id="\([^"]*\)" value="\([^"]*\)".*/\1\t\2\t\t/'
0       2200
2       5558889422188129
3       000000