Skip to content
Advertisement

Selenium Select the exact date from Datepciker

This is continuation of this question asked earlier Earlier question

I am able to select the date but the problem arises in below scenarios when there is some dates like

<td class="day disabled old">28</td>
<td class="day  active">15</td>
<td class="day  new">19</td>
<td class="day ">28</td>
  

I tried using XPath not contains but I am getting more than 1 element identified.

below is my code

(//div[@class='datepicker-days'])[3]/table/tbody//td[not(contains(class,'disabled'))][text()='28']

<td class="day disabled ">28</td>
<td class="day ">28</td>

I want to select only the dates which are below

<td class="day  active">15</td>
<td class="day ">16</td>

how to do that ?

Advertisement

Answer

Predicate [not(contains(class,'disabled'))] is not working as you should use @class not class:

[not(contains(@class,'disabled'))]
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement