title: Using hashmap in Java Selenium for verifying Months
body: <p>My automation framework is Perfecto cloud based using Selenium API in Java. 
  In my test scenario I need to open Calendar in Month view and then swipe it(Right to Left) and then verify the next month is displayed or not. 
  I read on few posts and found that HaspMap can be used for this. Can anybody guide me on how to use hashmap for such scenario. Some code snippet will really help.</p>
  
  <p>Test Steps:</p>
  
  <ol>
  <li>Launch Calendar in Month View</li>
  <li>Capture the current month (eg - March) and save in String curMonth</li>
  <li>Now swipe(right to left) for Month to Change</li>
  <li>Capture the value of the Month displayed on screen (Now comes April) and save in String nextMonth</li>
  <li>Verify the value nextMonth is actually the value next to curMonth</li>
  </ol>
  
  <p>Below code sample which I am trying to use. read the comments        </p>
  
  <pre><code>    HashMap&lt;String, Integer&gt; Table = new HashMap&lt;String, Integer&gt;();
      Table.put("JAN", 1);    
      Table.put("FEB", 2);    
      Table.put("MAR", 3);    
      Table.put("APR", 4);    
      Table.put("MAY", 5);    
      Table.put("JUN", 6);    
  
      String testdata="MAR";
      System.out.println("------------------------------------------------");
      Integer curMon = Table.get(testdata);
      System.out.println(curMon);
      //Here output will be 3 which it will fetch from the hashmap table
  
      //Now I am adding 1 from the return value which is 3. So 3+1=4 
      Integer newMonthValue=curMon+1;
  
      //Now how to associate the integer value which is 4 stored in newMonthValue and map it to April from the Map
  </code></pre>