title: groovy.lang.MissingPropertyException: No such property: Cols for class: Script1
body: <p>i have a list like below</p>
  
  <pre><code>List&lt;WebElement&gt; Cols = Rows.get(i).findElements(By.tagName('td'))
  </code></pre>
  
  <p>I have a method like below </p>
  
  <pre><code> public def queryGenerator(Map inputs)
  {
      def firstvalue = 'Cols.get('
      def Secondvalue = ').getText().equals('
      def thirdvalue = ')'
      def ampersand = '&amp;'
      def value = ''
  
      inputs.each({ def k, def v -&gt;
          int inum = Integer.parseInt(k);
          value = value + firstvalue+(inum-1)+Secondvalue+"\'$v\'"+thirdvalue+ampersand
  
      })
      return value.substring(0, value.length()-1)
  
  }
  </code></pre>
  
  <p>Now I am going to use Eval from groovy to convert this expression </p>
  
  <pre><code>String x = queryGenerator(values) //This will return Cols.get(0).getText().equals("some value")
  if(Eval.me(x){}
  </code></pre>
  
  <p>This gives following error </p>
  
  <pre><code>groovy.lang.MissingPropertyException: No such property: Cols for class: Script1
  </code></pre>
  
  <p>I have checked the groovy documentation most of Eval are using String, Object and Expression. Is there any way so that Eval can recognise the list. </p>