Forum Discussion

sanj's avatar
sanj
Super Contributor
7 years ago

How do I access data from a data source using groovy

Is there anyway to acess a specefic row using groovy?

 

  • Hi Sanj,

     

    Thank you for your post. Yes, it is possible. Please try the below script:

     

    def x = context.expand('${DataSource#columnName::0}') #make sure you mention the specific column name and run the whole loop(test case) to see specific values during an iteration. Hope this helps.

     

    Best,

    Lakshmi

  • lakshmiarun's avatar
    lakshmiarun
    SmartBear Alumni (Retired)

    Hi Sanj,

     

    Thank you for your post. Yes, it is possible. Please try the below script:

     

    def x = context.expand('${DataSource#columnName::0}') #make sure you mention the specific column name and run the whole loop(test case) to see specific values during an iteration. Hope this helps.

     

    Best,

    Lakshmi

    • Olga_T's avatar
      Olga_T
      SmartBear Alumni (Retired)

      Hi all,

       

      Thanks for your script, lakshmiarun!

       

      sanj, have you had a chance to try it?

      If it helps, could you please click the Accept as Solution button? This makes the search for the answer easier for other Community members.

       

      Thank you in advance,

       

      • sanj's avatar
        sanj
        Super Contributor

        Olga_T 

        you are rockstar thanks so much for the remainder

        I tried after I got your remainder

        it worked