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.
Date Popup
Hi,
I'm quite new with using Sahi. I'm getting a failure when the script goes to the part when a calendar popup opens and have choosen a date.
_click(_div("21"));
_setValue(_textbox("ctl00\$DefaultContent\$ctl14\$EffectiveDate"), "2010-07-21");
Please help. Thanks in advance.
I'm quite new with using Sahi. I'm getting a failure when the script goes to the part when a calendar popup opens and have choosen a date.
_click(_div("21"));
_setValue(_textbox("ctl00\$DefaultContent\$ctl14\$EffectiveDate"), "2010-07-21");
Please help. Thanks in advance.
This discussion has been closed.
Comments
Can you please specify the error too?
Please change your script as below:
_setValue(_textbox("ctl00\$DefaultContent\$ctl14\$EffectiveDate"), _cell( "2010-07-21"));
Here's the error:
_click(_div("21"));
Error: The parameter passed to _click was not found on the browser
No trace available
Rach: I tried your suggestion and I'm still getting the error.
Thank you in advance for your help.
This line is added because you have clicked on the web page..
I tried that before and did not get the error but that's not my desired test. Because I want to test the calendar popup. The way it works is when you click the field (_click(_div("21")); ) then the calendar pops up.
Thank you.
Can you please check the line which is comes before _click(_div("21"));
as per knowledge this should like:
you click on the date picker icon
then select the date from the date control
then you see the date selected..
for these steps you normally see the code as below, i have posted here some sample code snippet:
_click(_imageSubmitButton("ctl00\$cntMaster\$wzAddGift\$imgDatePicker2")); // This is click on image
_click(_div("Today: July 16, 2010")); //This is selection of date
_setValue(_textbox("ctl00\$cntMaster\$wzAddGift\$txtPayout"), "566"); //placing a value..
Hope this works.
Sadly it didn't work too.
If it may help, here's a part of the source code.
<span class="Fieldname"><a onclick="javascript:openDialogWindowAt('HelpText.aspx?fieldId=676C413E-67DF-4501-9F83-BA01480B368A',200,400,'FormHelp',50,100,true);return false;" id="ctl00_DefaultContent_ctl14_lblNewNationalPriceEffectiveDate" class="help-link" href="javascript:__doPostBack('ctl00$DefaultContent$ctl14$lblNewNationalPriceEffectiveDate','')">Effective Date:</a>
It'll be great if you can help me solve this problem.
Thanks a lot.
I am not sure with the code what you sent, after all i am tester, unable to understand how this works in you application.
Probably in your application the date control, have a pop window which is another URL link, then some server side validation happening it seems, hence you need to write a manual scripts to navigate to pop up window and selecting the date.
Note: Please Discuss with the developer about the flow based on that decide which API's is suitable to identify the HTML elements.
It looks like the textbox with id "ctl00\$DefaultContent\$ctl14\$EffectiveDate" is not available. One guess is that one of the steps for bringing up the popup was not recorded. Could you check that after clicking _div(21), the calendar comes up correctly?
Once the script fails, can you use the Controller to check if _textbox("ctl00\$DefaultContent\$ctl14\$EffectiveDate") is available? You can check this by:
Go to Record tab on Controller
Put _textbox("ctl00\$DefaultContent\$ctl14\$EffectiveDate") in Evaluate Expression box
Click "Test -->"
Check what the result is in the bottom box.
If it shows null, or error, see if your component is available and CTRL-Hover to check whether the id is the same.
Let us know what you find.
Regards,
Narayan
I was able to fix the problem by putting
_setValue(_textbox("ctl00\$DefaultContent\$dateCreatedFromTextBox"), "2010-07-20");
instead of the previous recorded script. The previous recorded script doesn't bring up the calendar popup.
Thank you very much for all the help.
Best Regards