Display results as :

Rechercher Advanced Search

Latest topics
» how to connect DB in selenium webriver
Fri Oct 06, 2017 4:09 pm by anbarasi

» How find any text in browser screen and click on it?
Thu Oct 05, 2017 2:02 pm by sandeepkommineni

» Selenium Webdriver
Tue Oct 03, 2017 1:35 pm by PiyushBiswas

» GRID setup tutorial.
Wed Sep 27, 2017 4:29 pm by johnyapp

» Drag & Drop Between Windows Using Selenium Driver
Wed Sep 27, 2017 2:10 pm by 26rondel

» Check if window is closed / verify input
Sat Sep 23, 2017 10:21 pm by brainstir

» How to work on pages with AJAX in selenium?
Mon Sep 18, 2017 6:08 pm by azharuddin

» pause test until user press a key like F2
Wed Aug 09, 2017 11:10 pm by djnforce

» Selecting the input for auto populating element
Sat Jul 29, 2017 7:53 pm by kdabbara


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;



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