title: Write Status of test case with Hash Map and Selenium
body: <p>I am using Hash Map to read the get excel data and use them in methods to perform If...else validations.</p>
  <p>I am using class file for initializing the Hash Map for reading the data. it goes as shown below</p>
  <pre><code>public class SampleDataset {
  
          public static HashMap&lt;String, ArrayList&lt;String&gt;&gt; main() throws IOException {
  
          final String DatasetSheet = &quot;src/test/resources/SampleDataSet.xlsx&quot;;
          final String DatasetTab = &quot;TestCase&quot;;
  
          Object[][] ab = DataLoader.ReadMyExcelData(DatasetSheet, DatasetTab);
  
          int rowcount = DataLoader.myrowCount(DatasetSheet, DatasetTab);
          int colcount = DataLoader.mycolCount(DatasetSheet, DatasetTab);
  
          HashMap&lt;String, ArrayList&lt;String&gt;&gt; map = new HashMap&lt;String, ArrayList&lt;String&gt;&gt;();
  
          // i = 2 to avoid column names
          for (int i = 2; i &lt; rowcount;) {
              ArrayList&lt;String&gt; mycolvalueslist = new ArrayList&lt;String&gt;();
              for (int j = 0; j &lt; colcount;) {
                  mycolvalueslist.add(ab[i][j].toString());
                  j++;
              }
              map.put(ab[i][0].toString(), mycolvalueslist);
              i++;
          }
  
          return map;
      }
  </code></pre>
  <p>I am using this map in my testcase file which is as shown below</p>
  <pre><code> @Test //Testcase
  public void testThis() throws Exception {
      try {
          launchMainApplication();
  
          TestMain MainPage = new TestMain(tool, test, user, application);
  
          HashMap&lt;String, ArrayList&lt;String&gt;&gt; win = SampleDataset.main();
          SortedSet&lt;String&gt; keys = new TreeSet&lt;&gt;(win.keySet());
  
          for (String i : keys) {
              System.out.println(&quot;########### Test = &quot; + win.get(i).get(0) + &quot; ###########&quot;);
              MainPage.step01(win.get(i).get(1));
              MainPage.step02(win.get(i).get(2));
              }
  
          test.setResult(&quot;pass&quot;);
      } catch (AlreadyRunException e) {
      } catch (Exception e) {
          verificationErrors.append(e.getMessage());
          throw e;
      }
  
  }
  
  @Override
  @After
  public void tearDown() throws Exception {
      super.tearDown();
  }
  </code></pre>
  <p>I want to write the status as PASS or FAIL for all the testcase initiated through above FOR-LOOP on to same excel by creating new column as Status for each row of test case</p>
  <p>my excel sheet is as shown below</p>
  <p><a href="https://i.stack.imgur.com/H6dks.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/H6dks.png" alt="SampleDataSet.xlsx" /></a></p>