Jump to content

Retrieve Value of XPATH variable


CRG2019

Recommended Posts

I am setting up/concatenating results of a loop to form an XPATH which resides in strChar2. I can't seem to be able to access the value of the XPATH. I have tried 50 or so variations of eval, evaluate, evalString, evalElement and so on - with no luck! Can you solve this? Note that strChar3 below is what I am trying to set up. strChar3 needs to contain the value of the XPATH (i.e. not the actual XPATH). I cannot hardcode the XPATH as getting values in a loop. Thanks for helping.

String strChar1 = evalString('$resultConvert/parameterType')
String strChar2 = "parm/uploadRecord/inputRecord/"+strChar1
String strChar3 = evalElement("strChar2")
                           

Link to comment
Share on other sites

This looks more like Java than Javascript, but Java only uses single quotes for char type values, not strings so this wouldn't work in Java either. Which programming language is this?

Link to comment
Share on other sites

It's actually groovy, but for some reason using javascript guides works better for us. Groovy guides never seem to work. So don't look at the quotes because I can work that out - try double quotes, single quotes, no quotes, etc. but I really want to find out the command to use that will transfer the XPATH. In scripting I've used "evaluate" before but it doesn't seem to work with this type of groovy. Thanks for any help you can provide!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...