0
votes

Is it possible to get data from 2 different excel files? I need this because I'm running different tests and I'd like to use some of the results as another's input.

here is my case;

I have an excel file named "Data1", has 3 colums "input1, input2, input3" This is my connection string for it:

[DataSource("System.Data.Odbc", @"Dsn=Excel Files;Driver={Microsoft Excel Driver (*.xls)};dbq=D:\TestProjects\Coded2\DataFiles\Data1.xls;defaultdir=.;driverid=79‌​0;maxbuffersize=2048;pagetimeout=5;readonly=true", "Sheet1$", DataAccessMethod.Sequential), TestMethod]

this is my method:

this.UIMap.ExampleParams.UIRtbSeriNoEditText = TestContext.DataRow["Input1"].ToString();
this.UIMap.ExampleParams.UIRntCevirmeOraniEditText = TestContext.DataRow["Input2"].ToString();
this.UIMap.ExampleParams.UIRntbKullanilanOranEditText = TestContext.DataRow["Input3"].ToString();

I'd like to add more lines to my coded ui test and set some values from other excel? or same excel's different sheet. Is this possible? If it is, can you edit my connection string according to it?

Thank you so much!

1

1 Answers

0
votes

I would create one (or more) method(s) which collect and combine the data from the different source to one collection and pass this collection to your test. Alternatively separate methods for each source and one to combine.

(Sorry but I can't provide you code at the moment)