18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
Automating JQuery DatePicker fields
Hi,
I am new to sahi and I am using twist with sahi driver. I have a JQuery Datepicker and was not able to automate it.
I am using windows and firefox 5. I am using Twist 2.0. The month and year selection from drop-down is not recorded using sahi controller. the date is highlighted as link. Please let me know how should I select a particular month/year in the drop-down of datepicker widget.
The html code is as follows:
<div id="ui-datepicker-div" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible" style="top: 415.05px; left: 664.167px; position: absolute; display: block;">
<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-all">
<a class="ui-datepicker-prev ui-corner-all" title="Prev" onclick="DP_jQuery.datepicker._adjustDate('#dp1313485327451', -1, 'M');">
<a class="ui-datepicker-next ui-corner-all" title="Next" onclick="DP_jQuery.datepicker._adjustDate('#dp1313485327451', +1, 'M');">
<div class="ui-datepicker-title">
<select class="ui-datepicker-month" onclick="DP_jQuery.datepicker._clickMonthYear('#dp1313485327451');" onchange="DP_jQuery.datepicker._selectMonthYear('#dp1313485327451', this, 'M');">
<select class="ui-datepicker-year" onclick="DP_jQuery.datepicker._clickMonthYear('#dp1313485327451');" onchange="DP_jQuery.datepicker._selectMonthYear('#dp1313485327451', this, 'Y');">
</div>
</div>
<table class="ui-datepicker-calendar">
</div>
Thanks,
Harika
I am new to sahi and I am using twist with sahi driver. I have a JQuery Datepicker and was not able to automate it.
I am using windows and firefox 5. I am using Twist 2.0. The month and year selection from drop-down is not recorded using sahi controller. the date is highlighted as link. Please let me know how should I select a particular month/year in the drop-down of datepicker widget.
The html code is as follows:
<div id="ui-datepicker-div" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible" style="top: 415.05px; left: 664.167px; position: absolute; display: block;">
<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-all">
<a class="ui-datepicker-prev ui-corner-all" title="Prev" onclick="DP_jQuery.datepicker._adjustDate('#dp1313485327451', -1, 'M');">
<a class="ui-datepicker-next ui-corner-all" title="Next" onclick="DP_jQuery.datepicker._adjustDate('#dp1313485327451', +1, 'M');">
<div class="ui-datepicker-title">
<select class="ui-datepicker-month" onclick="DP_jQuery.datepicker._clickMonthYear('#dp1313485327451');" onchange="DP_jQuery.datepicker._selectMonthYear('#dp1313485327451', this, 'M');">
<select class="ui-datepicker-year" onclick="DP_jQuery.datepicker._clickMonthYear('#dp1313485327451');" onchange="DP_jQuery.datepicker._selectMonthYear('#dp1313485327451', this, 'Y');">
</div>
</div>
<table class="ui-datepicker-calendar">
</div>
Thanks,
Harika
Comments
I tested the JQuery DatePicker fields using Sahi and java constroller. It works fine for me.
Here is an example:
http://jqueryui.com/demos/datepicker/#dropdown-month-year
Script using Sahi Controller:
Script using Java Controller:
Hope this helps you to solve your issue.
Regards
Sumitra
I guess, the code sample you gave me works for selecting a date in the defaulted month. I still want to know to select a particular month and year. I tried sahi controller and started recording on the example you provided...but its not working fine.
Suppose I want to select Oct-13-2012 and then again change it to Jul-15-2010 etc, in this case please give me a code sample. I am stuck in selecting a particular month and year.
The code to select Oct-13-2012:
The code to select Jul-15-2010:
Hope this will help you.
Regards
Sumitra
I tried to set up eclipse project for java code automation. I downloaded latest sahi jars and setup sample project as mentioned in your website.
But some of the lines in sample JavaClientTest.java don't compile
For eg:
browser.textbox("q").setValue("sahi forums");
browser.submit("Google Search").click()
Is there some compatability issue?
I searched on source forge and also same errors wrt jars
Please create a new forum post.
Can you check if there are any error on the console after you compile?
Also, post the error.
You can record the script using java controller and paste the recorded script into your java file.
You can now run this java file.
For more Details:
http://sahi.co.in/w/java
Regards
Sumitra