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.
Multiple Check Box Selection in a table
Hi,
I am facing a problem in which i am trying to select all rows of a table at a time.
At the exectution time its selecting each check box and moving forward , its not selecting all,
for an example ..if i have 5 rows in a table, then its able to select each row at a time, but the selection of check box is not staying ...nd as it move forward to next row its uncheck the previous row and check the next row. So in the end its selecting only one row..i.e is fifth row nd moving forward .
I am using this script.
_click(_cell(_table(8),rowNum,colNum))
I am facing a problem in which i am trying to select all rows of a table at a time.
At the exectution time its selecting each check box and moving forward , its not selecting all,
for an example ..if i have 5 rows in a table, then its able to select each row at a time, but the selection of check box is not staying ...nd as it move forward to next row its uncheck the previous row and check the next row. So in the end its selecting only one row..i.e is fifth row nd moving forward .
I am using this script.
_click(_cell(_table(8),rowNum,colNum))
This discussion has been closed.
Comments
yes, the checkbox is inside the cell
and m using this script
_click(_cell(_table(0, _in(_attributeWithValue(_byClassName("x-grid3-scroller", "div"), "div", "rowIndex", 0))), 0, 0))
_click(_cell(_table(0, _in(_attributeWithValue(_byClassName("x-grid3-scroller", "div"), "div", "rowIndex", 1))), 0, 0))
_click(_cell(_table(0, _in(_attributeWithValue(_byClassName("x-grid3-scroller", "div"), "div", "rowIndex", 2))), 0, 0))
_click(_cell(_table(0, _in(_attributeWithValue(_byClassName("x-grid3-scroller", "div"), "div", "rowIndex", 3))), 0, 0))
As every row in a table is a Div...
If u want any other information, thn let me knw.
please suggest me somthing
Thanks
Sudhir
for(var $idx=0; true; $idx++){
_click(_cell(_table(0, _in(_attributeWithValue(_byClassName("x-grid3-scroller", "div"), "div", "rowIndex", $idx))), 0, 0))
}
}catch(e){}
Your expression looks quite complex. Can you post the html source of the table here?
Regards,
Narayan
thanks for replying...
The problem here is not of selecting consecutive records, this
_click(_cell(_table(0, _in(_attributeWithValue(_byClassName("x-grid3-scroller", "div"), "div", "rowIndex", 0))), 0, 0))
should be used for selecting any row.
Moreover i am using the an excel file for testing where i am mentioning this function and giving corresponding row ,column values. If i want to select five records in a list, i will write 5 steps in excel file with their corresponding row, column no. But they all wil cal same function script that i mentioned above.
Please suggest me needful
Thanks
Sudhir
Not sure if this solves your problem, but couldn't _div("x-grid3-row-checker[ i ]") have identified that div? (Replace i with 1,2,3 etc.)
The checkboxes seem to be custom implemented. If you normally click and select a row, does it leave the older row selected? You are saying that older row gets unselected when selecting a new row, if only done via Sahi. Right?
Regards,
Narayan
thanks for looking into this issue.
I would like to tell somthing about the code,that i copied above...
The table is generated by Database, its a extjs gird table,
here every row is a table coming under div ( and the class is "x-grid3-scroller").
So if i look through sahi ..every row is recognizing like dis..
_div(21)
_div(23)
_div(28) and so on,
if i select all these div and write script like this
_click(_div(21))
_click(-div(23)) ...so on,
m able to click all required rows that i have mentioned in script. But the problem is i cant use this script for all table screens , as div() value wil get change in other screens.
And if i normally click the rows, they r working, the problem arises when i am trying to select through sahi.
M using this script
_click(_cell(_table(0, _in(_attributeWithValue(_byClassName("x-grid3-scroller", "div"), "div", "rowIndex", 0))), 0, 0))
because class name "x-grid3-scroller" is common in all grid tables, so this script is able to click a row in all screens, but fails in multiple selection. I want to make a generic solution for multiple selection in table for all screens.
And i have tried this one too
_div("x-grid3-row-checker[ i ]") where i put i=1, 2,3
Sahi is not able to recognize any row.
Please suggest me somthing
Thanks
Sudhir
ext-js generally has good examples online for all its components. If you can point me to an example, it will be very easy for us to reproduce and suggest a solution.
Regards,
Narayan
Please have a look at the solution posted here: http://sahi.co.in/forums/viewtopic.php?pid=5833
Regards,
Narayan
Thanks for your effort in resolving this issue.
I am using this script
_click(_byClassName("x-grid3-row-checker[1]","div"))
_click(_byClassName("x-grid3-row-checker[2]","div"))
_click(_byClassName("x-grid3-row-checker[3]","div"))
and its working good.
Thanks
Sudhir