0

I'm writing XP-VAPI scripts in HP ALM and some objects of the OTA-API use a construct which looks like this:

object.Field('nameOfField') = newValue;

Obviously this is not valid in Javascript. But because I use an IDE that checks the syntax according to ECMA standards this is shown as a syntax error. So I wonder is there a way to do this assignment with a proper Javascript syntax? I tried the following variants with no success:

CurrentRun.Field("RN_USER_13").value = 'pfusch';
CurrentRun.Field.RN_USER_13 = 'pfusch';
CurrentRun.Field["RN_USER_13"] = 'pfusch';
CurrentRun["RN_USER_13"] = 'pfusch';
CurrentRun.RN_USER_13 = 'pfusch';
4
  • What wasn't successful? What is the actual value of CurrentRun? Commented Aug 3, 2017 at 18:24
  • CurrentRun is an object with an expando property named 'RN_USER_13'. The problem is that the only way to set the value of this property is this horrible JScript syntax which is not allowed in Javascript. The funny thing is that Field() does not provide an object or a reference but just a read/write property. So the variants listed at the end were not successful in setting the value of this poperty. Commented Aug 3, 2017 at 18:44
  • They do use such a construct? Wow! Please post an answer to this question Commented Aug 6, 2017 at 21:20
  • @AlvaHenrik What exactly is the problem? Your script seems to run in a jScript runtime where that format is allowed, so why are you trying to change it? Commented Aug 6, 2017 at 21:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.