title: Comparing value in a variable with value of a text field
body: <p>I have a variable in a class <code>X</code>, i want to match its content with the value of a field in another class <code>Y</code>.<br>
  i have the following code in class <code>X</code>:</p>
  
  <pre><code>String Cellresult;
  Cell a1 = sheet.getCell(columNumber,rowNumber); // gets the contents of the cell of a an excell sheet
  Cellresult = a1.getContents();    // stores the values in the variable named Cellresult
  System.out.println(Cellresult);   // prints the values which is working fine till here
  </code></pre>
  
  <p>Now in another class <code>Y</code> , i want to compare the value of <code>Cellresult</code> with the value of an already filled field that has id <code>txtVFNAME</code>.</p>
  
  <p>I tried:</p>
  
  <pre><code>WebElement a = idriver.findElement(By.id("txtVFNAME"));
  if (a.equals(Cellresult)){
         System.out.println("text is equal");
  
  };
  </code></pre>
  
  <p>I am getting error even before compiling that ::<code>Cellresult cannot be resolved to a variable</code>.<br>
   I am using java, Eclipse, IE 10 , win 8.kindly help. many thanks. </p>