Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» FlexMonkium Download Not available under Gorillalogic site
Thu Dec 08, 2016 5:40 pm by bhanu.praveen

» Selenium Script issue
Tue Dec 06, 2016 9:48 pm by njain213

» Difference between QTP, Selenium and Silk test
Tue Dec 06, 2016 7:58 pm by jessicacyrus1

» Where does selenium script pick browser from
Tue Dec 06, 2016 1:52 pm by janbaskt

» Safari throws an HTTP ERROR: 404
Tue Dec 06, 2016 1:51 pm by janbaskt

» Access Denied Error in Selenium RC
Tue Dec 06, 2016 1:51 pm by janbaskt

» Automating Flex application through selenium webdriver
Fri Dec 02, 2016 2:06 pm by abhinay.krs

» Starting with Selenium, what is Selenium?
Mon Nov 28, 2016 4:00 pm by Foma

» Getting started with Selenium
Mon Nov 28, 2016 3:23 pm by Rebbelx

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

reading from an excel report -appreciate any urgent response

View previous topic View next topic Go down

reading from an excel report -appreciate any urgent response

Post by Auto_mate on Wed Apr 09, 2014 11:39 am

I recorded the code using selenium ide. Then the html was converted to C#/NUnit/Selenium IDE

the converted code i'm modifying to read data from an excel work book  called - Parametrization.xlsx

I inserted the code below to my code. But I'm having a difficulty identifying how to pass values to this piece of code,
string Value = (string)((Excel.Range)configurexlobj.Cells[rowconfigxl, 5]).Text;

appreciate if you could answer my below queries,

1) is the way I have done so far correct?
2) I need to pass a value in the 99th row column A- how can I do that using above code?  (its also a string)

    //Creating an xls object
    public static Excel.Workbook ExcelSetupProcess(string path)
    {
        Excel.Application excelApp;
       
        excelApp= new Excel.Application();
        Excel.Workbook Parametarization;
        Parametarization = excelApp.Workbooks.Open(path, 0, false, 5, "",        "",true,Excel.XlPlatform.xlWindows,"\t", true, false, 0,true, true, false);
        return Parametarization;
    }

    //Reading xls sheet
    public static void ProcessXLSFile(string fileName)
    {


    //private string ExcelSetupProcess;

    Excel.Parametarization workBookConfig = ExcelSetupProcess(fileName); // retuns the filename

    //Reading the xls workbook
    Excel.Worksheet configurexlobj = (Excel.Worksheet)workBookConfig .Sheets["PARAMETARIZATION"];

    //Process row by row
    int rowcntconfigxl = configurexlobj.UsedRange.Rows.Count;
    for (int rowconfigxl = 2; rowconfigxl <= rowcntconfigxl; rowconfigxl++)
        {
        //Here you have to write your code. I just given an example of below statement.
        string Value = (string)((Excel.Range)configurexlobj.Cells[rowconfigxl, 5]).Text;
        }
    }

Thanks

Auto_mate

Posts : 1
Join date : 2014-04-09

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum