Q:

getting tomorrows date and selecting it in datepicker using xpath c# webdriver

I am getting tomorrows date and I want to select it in datepicker using xpath. With xpath with no variables it works well, but when I try to add tomorrows date variable into the xpath, it fails, help me to fix xpath.
tried something like this but it did not work
string date1 = System.DateTime.Now.AddDays(1).ToString("dd");
driver.FindElement(By.XPath("/html/body/main/div/div/form/div[3]/div/div[2]/input[1]")).SendKeys("");
var date2 = String.Format("//div[contains(.,'{0}')]", date1);
driver.FindElement(By.XPath(date2)).Click();

xpath that works ( tr[5] means row 5 and td[4] means element 4, in picture example it would click day 15 ):
/html/body/main/div/div/form/div[3]/div/div[2]/div/div/div/div/div/table/tbody/tr[5]/td[4]/div

so I need xpath that will have tr[] and td[] containing the date1 variable, something like this but working
/html/body/main/div/div/form/div[3]/div/div[2]/div/div/div/div/div/table/tbody/tr[contains(date1)]/td[contains(date1)]/div

div id="AdmissionDateFilter_root" class="picker picker--opened picker--focused" aria-hidden="false"
 div class="picker__holder" tabindex="-1"
  div class="picker__frame"
   div class="picker__wrap"
    div class="picker__box"
     div class="picker__header"
     table id="AdmissionDateFilter_table" class="picker__table" aria-readonly="true" aria-controls="AdmissionDateFilter" role="grid"
      thead
      tbody
       tr
       tr
       tr
       tr
       tr
        td role="presentation"
        td role="presentation"
        td role="presentation"
        td role="presentation"
          div class="picker__day picker__day--infocus" aria-label="2015-11-19" role="gridcell" data-pick="1447884000000" 19 /div
        /td

A:

the html code provided is not clear.. please copy from firebug and paste it. In first xpath, position is provided like 5, so its working for that particular day. for second, to select dynamically today or next day, u r getting today from system and incremented correct? suppose 27+1, is that tr or td contains 28? 
if provided html code is correct, last div contains aria-label="2015-11-19", you can get system date in that format (yyyy-mm-dd) and pass that string in xpath like "//div[@aria-label='"+date+"']" (in java syntax), is that you are looking? 
Thanks

