18 January 2026:


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.

How to check checkbox from my excel sheet?

gunjangunjan Members
edited November -1 in Sahi - Open Source
Hi
Gunjan Here,

Can anybody help me how to use if and else statement for Checkbox

I want to capture data from excel sheet and send it on broweser

I am using windows 7, Sahi v3.5 and firefox 5.0

I have 2 check box
1st one is "My Entire Zone" and 2nd one is "Customize zone"

if i select My entire zone it select all zones saved in database

and if i select Customize zone i can select custom zone


I am using following script


if(_condition(!_checkbox("allZones").checked ))
{
_click(_checkbox("custom select"));

_click(_span("Customize Zone"));
//_wait(15000,_exists(elememt));
}
else
{


_click(_checkbox("allZones"));
}









// Get the DB instance
var db = _getDB("sun.jdbc.odbc.JdbcOdbcDriver", "jdbc:odbc:Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)}; DBQ=C:\\Test Data\\Book19.xls;readOnly=false", "", "");

$rs = db.select("select * from [Sheet1$]");

for(var $i=0; $i<$rs.length; $i++)
{

simplebid($rs[$i]["bidNameTxt"],$rs[$i]["allZones"],$rs[$i]["custom select"],$rs[$i]["x-grid3-row-checker"]);

}

_click(_button("Add Bid"));
_click(_button("Yes"));
_wait(15000,_exists(elememt));


in my result it select custom zone but suppose i want to select all zones than? what script should i write?


In my excel what data should i fill up?

my excel sheet is given below

bidNameTxt allZones customselect x-grid3-rowchecker
Test bid checked unchecked

Should i write checked or unchecked
null or not null
true or false
yes or no


Can any body help me to solve this issue?

please reply me fast , I want to solve it as soon as possible

Waiting for your favorable reply.


Thanks,
Gunjan.
Sign In or Register to comment.