jsreesoap
12 years agoContributor
[Resolved]Dynamic proplerties not getting values assigned
for (x in 0..1)
{
//testRunner.testCase.setPropertyValue("IndAcct",myArray[x])
testRunner.testCase.setPropertyValue("AccountId",myArray[x])
def responseAsXml = context.expand( '${GET Restrictions on an Account#ResponseAsXml#//Response[1]/e[1]/accountRestrictionId[1]}' )
testRunner.testCase.setPropertyValue("Restriction"+[x],responseAsXml)
}
I created an array and assigned account numbers accordingly. So myArray[0] has value 123 and myArray[1] has value 456.
I have the above code to run 2 account numbers and get restrictions on those respectively. The restriction id comes in the same node every time as shown in the script. As the value is dynamic I am writing to dynamic property (every time I run it is supposed to create the property and write the value. For example first time it runs account 123 whcih has restrictions id as abc123 it writes the restrictions id to Restriction0 property.Second time it picks up the other account 456 with restrictions id xyz456 and writes to Restriction1 property. When I execute the script it is creating the dynamic properties but not writing the values. I have to click on the play button in groovy script to make it write. Then it writes the last value to both the properties.
Attached is the screen shot. Basically I need to run bunch of accounts in iterations and each iteration will pick up the restricion id for that account. This restriction id and the corrosponding account number should be written to different properties so that I can use those account and restriction pair in my other script to delete restriction on each account.
I understand you dont support the coding but in this case when I retrieve the response value from the response with built in funtion and assign to dynamic property it is not writing the value.
Any help is appreciated
{
//testRunner.testCase.setPropertyValue("IndAcct",myArray[x])
testRunner.testCase.setPropertyValue("AccountId",myArray[x])
def responseAsXml = context.expand( '${GET Restrictions on an Account#ResponseAsXml#//Response[1]/e[1]/accountRestrictionId[1]}' )
testRunner.testCase.setPropertyValue("Restriction"+[x],responseAsXml)
}
I created an array and assigned account numbers accordingly. So myArray[0] has value 123 and myArray[1] has value 456.
I have the above code to run 2 account numbers and get restrictions on those respectively. The restriction id comes in the same node every time as shown in the script. As the value is dynamic I am writing to dynamic property (every time I run it is supposed to create the property and write the value. For example first time it runs account 123 whcih has restrictions id as abc123 it writes the restrictions id to Restriction0 property.Second time it picks up the other account 456 with restrictions id xyz456 and writes to Restriction1 property. When I execute the script it is creating the dynamic properties but not writing the values. I have to click on the play button in groovy script to make it write. Then it writes the last value to both the properties.
Attached is the screen shot. Basically I need to run bunch of accounts in iterations and each iteration will pick up the restricion id for that account. This restriction id and the corrosponding account number should be written to different properties so that I can use those account and restriction pair in my other script to delete restriction on each account.
I understand you dont support the coding but in this case when I retrieve the response value from the response with built in funtion and assign to dynamic property it is not writing the value.
Any help is appreciated