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.
Sahi with Datepicker.
Hello,
Can anybody tell me that how Sahi works well with Datepicker means selects date from Date picker?
Can we customize the script manually , so that it can select any date which we give in the script, from the Date picker while executing the test case in browser with Sahi?
Thanks in advance.
Can anybody tell me that how Sahi works well with Datepicker means selects date from Date picker?
Can we customize the script manually , so that it can select any date which we give in the script, from the Date picker while executing the test case in browser with Sahi?
Thanks in advance.
Comments
Thank s a lot.Thanks for your simple way to use dates.
But may i know "Is SAHI works perfect with datepicker?"
Thanks in advance.
Datepicker is not native HTML. It is generally a custom widget and is implemented differently by different javascript libraries.
It would be difficult for someone who does not know which framework you use, to say whether it works perfectly. In fact you should be able to say whether it works or not!
Sahi works well with most javascript widgets, but if you think it does not work with your widget, point us to an example and we will fix it for you.
Regards,
Narayan
Some of my recorded scripts are as follows:-
_click(_cell("2")); // July 2-'09
_click(_cell("17[2]"));// June 17-'09
_click(_cell("10[7]"));// Aug 10-'09
_click(_cell("10[1]"));// Aug 10-'2010
If this the script type , then how can i give a date of my choice in the script ,for ex:- 09/10/2011, so that while playback it selects the given date from datepicker.I dont want to set the date in the text feild.
Thanks in Advance.
Can you try this:
Put _cell("17[2]") in the accessor field and click "Props", and then paste the output here. We should be able to identify that element in some other easier way. Also try to get the out put of this:
_parentNode(_cell("17[2]"), 5).innerHTML
If the output is huge or you are unable to paste it here, you can email this to me at narayan@sahi.co.in
Noticed during plaback that the date calendar never closed and the date did not appear in the corresponding field field.
That calendar has been rendered using document.write and so will not lend itself to recording.
To perform various steps on that window, follow these:
1) To select a different month:
_setSelected(_select("MonthSelector", winCal), "October");
2) To use the arrow keys around year:
_click(_link("<", winCal));
_click(_link(">", winCal));
3) To click on a date (say, 23rd):
_click(_link("23", winCal));
Basically, what we are doing here is telling the Sahi APIs to look for the link, select box etc in a different window. In this datepicker, the window name is conveniently available in a variable called winCal. (I got this from the datepicker javascript code.)
So instead of doing _link(">"), we do _link(">", winCal), so that Sahi knows to search for the ">" link in the window object winCal.
Thank you,
If I were to compare the selected date:
_click(_link("23", winCal)) will give me 11/23/2009
with system date. Is it possible to use a _getText(_byId(“divsome”))?. It gives me a null value.
I would like to grab the value received from the _click part .
The calendar for my application looks somewhat like this :
=====================
November 2009
=====================
<<Month>> <<Year>>
=========================
|1 | 2|3|......
28|29|30
==================
my window object for e.g: is vWinCal.
_click(_link(>>,vWinCal) and _click(_link(<<, vwinCal)); does not return anything. In the example link that was provided : month was a drop down box so the _setSelected(_select(MonthSelector", winCal), "October"); would work there. Am I missing something here
Thanks again,
pls can anyone tell me that how Sahi works with Datepicker means selects date from Date picker.
i want to select date from script..i want to automate the script for datepicker..pls can sumone suggest me the code..i tried that code which is given above but it didn't worked for me.
pls rply soon..
can u please suggest me something regarding my problem..
please suggest me regarding my datepicker problem. I am not able to automate it..
Waiting.
Thanks
You will have to give some example, some information if you want help. Please post a separate query with details which will let others reproduce the issue and help you. Please do not append to old posts. In your case, you will need to specify the browser, the operating system, the web framework you are using, what you tried, what happened, and what is the desired behavior.
Regards,
Narayan