Geeks Talk

Prepare for your Next Interview




Is there any limit to number of columns in excel file, when reading it from script?

This is a discussion on Is there any limit to number of columns in excel file, when reading it from script? within the WinRunner forums, part of the Software Testing category; Hi..! Please help,I am not facing this issue. When i use a ddt_get_parameters(tableName,parametersList,numberOfParameters), i am not able to read the table's column after column 'BK'. ...


Go Back   Geeks Talk > Software Testing > WinRunner

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 03-05-2008
Junior Member
 
Join Date: Feb 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
sandeepdesai7 is on a distinguished road
Is there any limit to number of columns in excel file, when reading it from script?

Hi..!
Please help,I am not facing this issue.

When i use a

ddt_get_parameters(tableName,parametersList,numberOfParameters),

i am not able to read the table's column after column 'BK'.

is there any limit on the columns that this method can read from an excel sheet??
Thanks,.,!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-05-2008
Expert Member
 
Join Date: Oct 2007
Location: Mumbai
Posts: 347
Thanks: 4
Thanked 54 Times in 44 Posts
bizzzzzare is on a distinguished road
Re: Is there any limit to number of columns in excel file, when reading it from scrip

Hi Sandeep,

There is no limit as such to the number of columns that can be read. Do you get any error message on executing dddt_get_parameters.

Also ensure that after BK there is no blank column in the Excel file.

Incase there is a limit, WR should return a error code either stating "E_MAX_COLUMNS_EXCEEDED" error number -10045 or "E_NOT_PARAMETER".

do let me know about the details....

Cheers....
__________________
Regards,

V.Umesh Krishnan
QA Consultant
Reply With Quote
  #3 (permalink)  
Old 03-05-2008
Junior Member
 
Join Date: Feb 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
sandeepdesai7 is on a distinguished road
Re: Is there any limit to number of columns in excel file, when reading it from scrip

HI..!
thanks for the reply,

Here is my full code.

public function Read_From_File(in dTable,in rowStart,in rowEnd)
{

#Section : Variables Declaration

auto sParamList; #string-Stores the list of parameters in the datatable
auto sKeyWord; #string-hold the keyword after the substring operation.
auto nParamNumber; #numeric- To hold the number of parameters in the data table
auto aFields[]; #array-To hold the fields and the keywords defined as parameters in the datatable
auto sData; #String that holds the string retreived from the data table
auto table_RowCount;
auto enum;

#ddt_open(dTable,0);

rc = ddt_open(dTable, DDT_MODE_READ);

ddt_get_parameters(dTable,sParamList,nParamNumber);

split(sParamList,aFields," "); # the separator is a tab

ddt_get_row_count(dTable,table_RowCount);


for(table_Row=1; table_Row <= table_RowCount ; table_Row ++)
{

ddt_set_row(dTable,table_Row);

report_msg("Checking Row With Row.No: " & table_Row);

for(enum = 2; enum <= nParamNumber; enum++)#reading only from column 2.
{

sKeyWord = substr(aFields[enum],1,7);#getting the the current column header.
sData=ddt_val(dTable,aFields[enum]);#getting the value of the cell of current row and column.

switch(sKeyWord)#depending on header, ill perform some actions.
{
case "BtnPrss":
button_press(sData);
break;

case "evalfnc":
eval(sData);
break;

.....Many more cases.


I am calling this function from main script like this.

Read_From_File("C:\myFolder\sheet1",1,5);

and in sheet1,

i am calling the same function again in the header evalfnc,
like,cell value = Read_From_File("C:\myFolder\sheet2",10,15); in sheet 2.

Here i am facing this problem,

I can read all the column headers from sheet1,(no limit.)
but inside sheet2,i can read only till column 'BK'.


I am not able to figure out why i am not able to read the headers after the column.

Does it have anything to do with calling the same function within the function??
Reply With Quote
Reply

  Geeks Talk > Software Testing > WinRunner


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
Datatable: Creation, Writing and Reading the values from Excel Sheet ravisuriya QTP 3 02-29-2008 11:41 AM
Read excel values into script without opening excel nemishdmehta QTP 1 02-11-2008 07:19 AM
Run sample graph reading a file sheker2007 Data Warehousing 2 09-25-2007 02:59 PM
reading data from excel sheet in QTP JobHelper QTP 4 09-11-2007 07:33 AM
Reading a TSR file JobHelper QTP 1 07-27-2007 07:33 AM


All times are GMT -4. The time now is 08:48 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved