cancel
Showing results for 
Search instead for 
Did you mean: 

Test complete should provide DDTDriverObj.RowCount

Ryan_Moran
Valued Contributor

RE: Test complete should provide DDTDriverObj.RowCount

As a solution to this in my own data driven scripts I have implimented an index to all my sheets named "Row".

eselect is a function that executes sql select statements and returns the recordset.

ecommand is a function that executes sql commands.

The indexing runs when I start my test and takes approx. 5-10 seconds at most.

Additionally you'll notice that I pull the "rowcount" with a select statement when the indexing starts. Enjoy.



JScript example:




function indexsheet(){


var rs = eselect("SELECT Count(*) From [Script$]");


while (!rs.EOF){


 c = rs(0).Value;


 rs.MoveNext;


 }


rs.close();


rs = null;


ecommand("Update [Script$] Set [Row] = ''");


for (var x = c + 1;x > 1;x--){


 ecommand("Insert Into [Script$A" + (x - 1) + ":A" + (x - 1) + "] VALUES (" + x + ")");


 }


}


''-Praise the sun and Give Kudos.''
Ravik
Super Contributor

RE: Test complete should provide DDTDriverObj.RowCount

Yes Ryan Moran ,



I am agree with you, I have also implemented something in VBScript.



Payal,



If you want to get the row count from the excel sheet you can follow the below approach-

 


Set  Exo=CreateObject("Excel.Application")


Set Wbo=Exo.WorkBooks.Open("Your Path")


Set Wso =Wbo.WorkSheets(1)


rowCount = Wso.usedrange.rows.count



Where -

Exo = Excel Object

Wbo = Workbook Object

Wso = Worksheet Object

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors