Forum Discussion

M_McDonald's avatar
M_McDonald
Super Contributor
15 years ago

Property Transfer not expanding Property step value

I have a Property which contains a reference to a TestCase property, which is in turn referenced by a Property Transfer step. Apparently the Property Transfer is not expanding the Property value before applying the xpath - I get an error "Unexpected element:CDATA".

If I replace the Property value with an actual xml value, the transfer works fine.

Please see project attached. I am using build 3.0-pro-daily-build-2009-11-18-[2].

3 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi!

    well.. it's not a bug really, Property Transfers don't expand values of properties they are transferring, and I don't want to change this since it might break someone else code..

    What you could do is add a DataGen TestStep to your TestCase containing a property named "xml" of type "Template" and then set the content of that property to ${#TestCase#xml}; in your property-transfer then specify this property as source instead; it will get evaluated as you need (be sure to the the datagen property to mode = READ as well).

    I've attached an updated project that shows this..  does that suffice?

    regards!

    /Ole
    eviware.com
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    I worked around it by using another Property Transfer to move the TestCase property to the Properties step, but your method is 1 step less so it's the winner!

    I'm not sure I see the value in not expanding, but maybe an option could be added to the Property Transfer step to turn expansion on and off?

    Thanks.
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    good idea, I think it could definitely be useable.. it's on the list..

    regards,

    /Ole
    eviware.com