Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
yoursjcp
yoursjcp
Active particpant
Active particpant
Posts : 10
Join date : 2010-07-22

DataDriven from Excel in C# with NUnit Empty DataDriven from Excel in C# with NUnit

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
avatar
snookala
Posts : 4
Join date : 2010-09-03

DataDriven from Excel in C# with NUnit Empty Re: DataDriven from Excel in C# with NUnit

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
yoursjcp
yoursjcp
Active particpant
Active particpant
Posts : 10
Join date : 2010-07-22

DataDriven from Excel in C# with NUnit Empty Re: DataDriven from Excel in C# with NUnit

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
avatar
snookala
Posts : 4
Join date : 2010-09-03

DataDriven from Excel in C# with NUnit Empty Re: DataDriven from Excel in C# with NUnit

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
Sponsored content

DataDriven from Excel in C# with NUnit Empty Re: DataDriven from Excel in C# with NUnit

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