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.
Unable to set date value into a readonly textbox
Hi team,
I have a problem sahi can not find the ID of the textbox defined below.
<input name="ctrlPETimeline$ctrlTimelines$cgProjects$txtEnd_-1$txtDate" id="ctrlPETimeline_ctrlTimelines_cgProjects_txtEnd_-1_txtDate" style="text-align: left; width: 100%; background: none transparent scroll repeat 0% 0%;" onchange="CheckDateValue(this);SelectedEndDate(this);SelectedEndDate(this);" type="text" readOnly="readonly" ToolTip=""/>
This textbox has a small button next to it, when you click the button a calendar displays and when you select a date from the calendar, selected date get sets in the textbox.
when I set the value using sahi controller I get the "undefined" error. When I manually set the value it works but when i set i via sahi it doesn't. I have been stuck with this problem for the past 4 days and I am turning into circles.
_setValue("ctrlPETimeline_ctrlTimelines_cgProjects_txtStart_-1_txtDate", "22 Aug 2012");
Thank you for your hep. :-)
I have a problem sahi can not find the ID of the textbox defined below.
<input name="ctrlPETimeline$ctrlTimelines$cgProjects$txtEnd_-1$txtDate" id="ctrlPETimeline_ctrlTimelines_cgProjects_txtEnd_-1_txtDate" style="text-align: left; width: 100%; background: none transparent scroll repeat 0% 0%;" onchange="CheckDateValue(this);SelectedEndDate(this);SelectedEndDate(this);" type="text" readOnly="readonly" ToolTip=""/>
This textbox has a small button next to it, when you click the button a calendar displays and when you select a date from the calendar, selected date get sets in the textbox.
when I set the value using sahi controller I get the "undefined" error. When I manually set the value it works but when i set i via sahi it doesn't. I have been stuck with this problem for the past 4 days and I am turning into circles.
_setValue("ctrlPETimeline_ctrlTimelines_cgProjects_txtStart_-1_txtDate", "22 Aug 2012");
Thank you for your hep. :-)
Comments
where is your element? shouldn't it be _setValue(_textbox("ctrlPETimeline_ctrlTimelines_cgProjects_txtStart_-1_txtDate"), "22 Aug 2012");
I meant to say _setValue(_textbox("ctrlPETimeline_ctrlTimelines_cgProjects_txtStart_-1_txtDate"), "22 Aug 2012"); this does not set the value to the textboox.
Do you perhaps have an idea on how can I overcome this.
thanks again
I tried this and it works like a charm :-)
_assertFalse(_textbox("ctrlPETimeline_ctrlTimelines_cgProjects_txtStart_-1_txtDate").readOnly=false);
_setValue(_textbox("ctrlPETimeline_ctrlTimelines_cgProjects_txtStart_-1_txtDate"), "22 Aug 2012");
the value now gets set into the textbox and the value is committed when I click the save button.
Thanks
I have one more question, How would you check if a textbox or a button is disabled using he if statement?
I want to achieve something like this:
if(_getAttribute(_submit("btnRequestApproval")), "disabled"==true)
{
//do something
}
else
{
//do something else
}
//$textbox= _collect("_textbox", "/.*/", _in(_table(28)));
//_debug($textbox);
//_debug("Total No. of TextBoxes: "+ $textbox.length);
_set($textbox, _count("_textbox","/.*/"));
_alert($textbox);