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

DataDriven from Excel in C# with NUnit

View previous topic View next topic Go down

DataDriven from Excel in C# with NUnit

Post by yoursjcp on Thu Sep 09, 2010 7:57 pm

Hi Everyone

Nice to See an active Selenium Forum.

Previously i used This in JAVA but now the client require that in C#
but iam new to C#..i never used..even i tried to run some tests by learning from the net.
Now i have a big test to do this task...
Kindly any one can help me in this task.

Regards
boBby

yoursjcp
Active particpant
Active particpant

Posts : 10
Join date : 2010-07-22

Back to top Go down

Re: DataDriven from Excel in C# with NUnit

Post by snookala on Fri Sep 17, 2010 8:42 pm

Hi

May be this is the late response to you but let me know what exactly you want to do still if you are looking for some help.

I am also working with C# and keyword driven testing.

Cheers

snookala

Posts : 4
Join date : 2010-09-03

Back to top Go down

Re: DataDriven from Excel in C# with NUnit

Post by yoursjcp on Fri Sep 17, 2010 9:11 pm

Hi Thanks for ur msg...

Ya i need the same which i used in Java
the link which i used in java is...
http://functionaltestautomation.blogspot.com/2009/10/dataprovider-data-driven-testing-with.html

Iam unable to make same as this
Kindly Pls help me

Regards
boBby

yoursjcp
Active particpant
Active particpant

Posts : 10
Join date : 2010-07-22

Back to top Go down

Re: DataDriven from Excel in C# with NUnit

Post by snookala on Fri Sep 17, 2010 10:07 pm

Hi boB,
Ok...
Have you configured the C# with Selenium RC, if not then follow the information provided in the link http://thetestingblog.com/2009/09/10/selenium-rc-in-c-using-nunit-an-end-to-end-example/

The below code is for creating xls object

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

The below one is reading xls sheet

public static void ProcessXLSFile(string fileName)
{


//private string ExcelSetupProcess;

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

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

//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;
}
}

Cheers

snookala

Posts : 4
Join date : 2010-09-03

Back to top Go down

Re: DataDriven from Excel in C# with NUnit

Post by Sponsored content Today at 3:47 pm


Sponsored content


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