0

Is it possible to access more than 255 columns of Datasource (Excel) using Coded UI, currently I am using VSTS 2013 and found that Coded UI is not able to access more than 255 columns from the DataSource. Is there a way to overcome this limitation? I don't want to split my test case in two parts, also I have to use Excel as DataSource.

  • Why not just use a datatable as source and fill it with data from your excel? – AlexCharizamhard Feb 9 '16 at 15:49
  • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review – IAmMilinPatel Feb 9 '16 at 16:10
  • Can't use that or you can not allowed to use Database, as I have already created many cases using Excel and in addition to it, I have customized Excel (like binding it with same lookup value as in application, to have dropdowns for selection), Color Coding, Rules for dependent column values etc. Is there a way (lets say some plugin or extension or new version of Coded UI) which can eliminate this column size issue? – Dhiman Feb 9 '16 at 16:37
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. - From Review – Kate Paulk Feb 10 '16 at 12:25
1

One possibility is to include delimited fields within the Excel cells. I normally use CSV ("comma" separated values) for the data source file but the conversion to and from an Excel spreadsheet is easy. A simple example with pipe ( |) delimited field within the CSV would be:

FieldA,FB,SFC1|SFC2|SFC3,SFD-3,FieldE
AAone,BBtwo,CCthree|CCfour|CCfive,DDsix|DDseven|DDeight,FFnine

Here five CSV (Excell) cells are separated by commas. Two of them have pip delimited sub-fields. Giving nine fields in total.

To use the above fields you might do something like:

string[] SFC = TestContext.DataRow["SFC1|SFC2|SFC3"].ToString().Split('|');
string[] SFD = TestContext.DataRow["SFD-3"].ToString().Split('|');

string ValueOfFieldA = TestContext.DataRow["SFD-3"].ToString();
string ValueOfSFC2 = SFC[1];
string ValueOfSFD3 = SFD[3];

Using a field name like SFC1|SFC2|SFC3 may be useful for documentation, but naming all the subfields may be excessive. Having a shorter field name such as SFD-3 gives the hint that three fields are expected.

Note that the array indexing in SFC[1] and SFD[3] should probably be preceded by a check that the elements actually exist.

  • looks a good option to me, this way I can reduce the total number of columns so that they fall under 255. – Dhiman Feb 10 '16 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.