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.
Script in evaluate exp while recording it does not work in playback
OS: fedora 14 (Laughlin) kernel 2.6.35.13-92.fc14.i686
Browser : Google-Chrome 12.0.742.124
Sahi build : 2011-07-19
Hi,
Sometimes I am facing Problem in executing Sahi scripts...the code executes properly in Evaluate Expression Textbox in Sahi controller does not work properly in script while it playbacks....
I have scenario like this..
I have list of experiment among which I will select some for users by using checkbox...and I have a defualt experiment which is enabled for all the user....so when I create new user the default should be enabled...if it is unchecked in checkbox then it should be checked and it will be included into the list of experiments available on the user's home page to perform..what I am testing here , whatever checkbox is checked I will get its experiment name by "_getText(_getAttribute(_checkbox("__selthisexp"),"nextSibling"))" function as per my html code , stores it in one variable and checking , is it enable or not on the user's home page by looking it's name in available experiments' list
.
but "_getText(_getAttribute(_checkbox("__selthisexp"),"nextSibling"))" works proper in evaluate expression textbox , it give the proper name of experiment but goes in recursion while executing it in scripts in playback...
HTML code is as below.....
<div id="__projexpadd">
<div class="fdiv coldiv">
<input id="__selthisexp" type="checkbox" title="Select / Unselect to Add / Remove this Experiment from this User's list" onclick="" checked="checked" name="__selthisexp" value="8">
<span style="margin-left: 5px">Analog Design Flow</span>
</div>
</div>
Sahi Scripts:
if(_assertFalse(_checkbox("__selthisexp")))
{
_check(_checkbox("__selthisexp"));
}
_click(_link("Update Experiments"));
$check_exp=_getText(_getAttribute(_checkbox("__selthisexp"),"nextSibling"));
Is it right?....or Is there any bug in Sahi...?
Browser : Google-Chrome 12.0.742.124
Sahi build : 2011-07-19
Hi,
Sometimes I am facing Problem in executing Sahi scripts...the code executes properly in Evaluate Expression Textbox in Sahi controller does not work properly in script while it playbacks....
I have scenario like this..
I have list of experiment among which I will select some for users by using checkbox...and I have a defualt experiment which is enabled for all the user....so when I create new user the default should be enabled...if it is unchecked in checkbox then it should be checked and it will be included into the list of experiments available on the user's home page to perform..what I am testing here , whatever checkbox is checked I will get its experiment name by "_getText(_getAttribute(_checkbox("__selthisexp"),"nextSibling"))" function as per my html code , stores it in one variable and checking , is it enable or not on the user's home page by looking it's name in available experiments' list
.
but "_getText(_getAttribute(_checkbox("__selthisexp"),"nextSibling"))" works proper in evaluate expression textbox , it give the proper name of experiment but goes in recursion while executing it in scripts in playback...
HTML code is as below.....
<div id="__projexpadd">
<div class="fdiv coldiv">
<input id="__selthisexp" type="checkbox" title="Select / Unselect to Add / Remove this Experiment from this User's list" onclick="" checked="checked" name="__selthisexp" value="8">
<span style="margin-left: 5px">Analog Design Flow</span>
</div>
</div>
Sahi Scripts:
if(_assertFalse(_checkbox("__selthisexp")))
{
_check(_checkbox("__selthisexp"));
}
_click(_link("Update Experiments"));
$check_exp=_getText(_getAttribute(_checkbox("__selthisexp"),"nextSibling"));
Is it right?....or Is there any bug in Sahi...?
Comments
Don't use _assertFalse API in if condition,since it does not return any value, and throws an exception if the condition is false.
The following code might help you,
Regards,
Theeran.