RE: Jquery Datepicker

I have the following code  but its not selecting the date:  it is printing the required date but not selecting on the web

 

sam Default Asked on February 20, 2015 in Selenium WebDriver.
Add Comment
3 Answers

If we look at the calander the html code is
<td class=”  ui-datepicker-current-day” onclick=”DP_jQuery.datepicker._selectDay(‘#dp_pu’,1,2015, this);return false;”><a class=”ui-state-default ui-state-active” href=”#”>25</a></td>
<a class=”ui-state-default ui-state-active” href=”#”>25</a>
</td>

The point here is that <a/> tag is the one which should get the click command. in your Calender class you must be doing sending click to the <td/> tag.

Try reversing the click() on either of the two.

Also if you analyze the html you will see that the <td> tag has onclick javascript. you can execute the java script your self to select that element.

DP_jQuery.datepicker._selectDay(‘#dp_pu’,1,2015, this);return false;

just change the second and third parameter yourself and use the executeJavascrit methos.

Thanks
Virender

Professor Answered on February 23, 2015.

Hi Virendar ,

thanks for the reply but the calendar image is a span element it is not allowing to using any click method , how do i resolve this

on February 24, 2015.

//span[@id=”dp_pu_img”]

on February 24, 2015.

Let me get back to you  from home. I will try to write a small test and share the code.

Thanks
Virender

on February 26, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.