title: Selenium Junit Writing Value of webelement into excel
body: <p>In Selenium using Junit I am creating a registration into a website. Once the registration is successful a MRN number will be generated . I want to write this MRN number from the website into Excel sheet .Which I will be using for my further test cases .
     When I am trying to write it I am getting a error as type Mismatch .As the value to be written into the excel is String and I am fetching a webelement .Can one help me and let me know the method to write the value of a webelement into excel sheet . </p>
  
  <p>Here is my logic</p>
  
  <pre><code>   boolean fieldtoverify =   AppLogin.f1.findElement(By.id("navigation:mrnoId")).isDisplayed();
  WebElement MRN= AppLogin.f1.findElement(By.id("navigation:mrnoId"));
  
  testreport tr = new testreport();
  ExcelHelp ers = new ExcelHelp(System.getProperty("user.dir") + "\\src\\TestData\\testdata.xlsx");
  if(fieldtoverify){
      //Update test case execution report
      rNum=ers.findrownum("Registration", "MRN", 1);
      ers.datawrite("Registration", rNum, "MRN", MRN);
  </code></pre>
  
  <p>Please help</p>