radhika1
7 years agoContributor
how to use a variable in context.expand
Can u tell me how to use a variable inside this.
def y =1;
def g = context.expand('${Operation#Response#//*//consumerProfile/phoneNumber["+y+"]}');
this is not taking 1 as value of y
Some other problem with this Xpath then?
def y = 1 assert '${Operation#Response#//*//consumerProfile/phoneNumber[' + y + ']}' ==
'${Operation#Response#//*//consumerProfile/phoneNumber[1]}'