-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
XML request templating #48
Comments
That is a great question and for the time being I don't have a great solution for the conditional age tag other than using a JavaScript function, but I see a gap where manipulating XML inside JS may not be supported fully yet. The way Karate is designed, you can certainly achieve this if you call some Java code. Take a look at Java interop. Meanwhile I will consider this as a feature request. Hope you are aware that XML templating works exactly like JSON where any element (or attribute) values in the #() form will evaluate expressions within the brackets. |
thanks for the prompt reply. i tried Examples: 00:10:26.991 [main] WARN com.intuit.karate.Script - embedded xml-text script eval failed: script failed: (name) |
Try something like this: * def name = '<name>'
* def query = <SubjectName>#(name)</SubjectName> |
@venkatesgopi not sure if you are watching this ticket, but can you try this example: This should work in version 0.4.0-SNAPSHOT I'd like to know if this works for you. |
Thanks lot for the support. i will check and get back to you very soon. |
Do you have any option for SOAP XML request template and reusing example table
In the below example there are two place holders one for filling firstName and lastname
i will define EXAMPLE table with firstName and lastName alone but i dont define AGE in that case AGE tag should be get removed.
Sample
XML request format
Could you please provide solution for this scenario
The text was updated successfully, but these errors were encountered: