Ask a Question

How to get value of array elements starting with alphabets

Tek_Travels_Pvt
Occasional Contributor

How to get value of array elements starting with alphabets

Hi Team,

 

I am using Ready API and using Data Gen to get value from an array created in same data gen. I am not able to retrieve elements from array starting with alphabets while the same is working for the elements starting with numbers. Below is the screens for both. Please provide the solution.

 

 

 

1 REPLY 1
JKambli
Staff

Try this,

By default properties convert to String. so you need to reconvert them to array and retrieve values

def airlineCode = context.expand( '${AirlineCode#AirlineCode}' )

codes= airlineCode.replaceAll("\\[","").replaceAll("]","").split(",")

return codes[0].toString()


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
cancel
Showing results for 
Search instead for 
Did you mean: