Forum Discussion

vi's avatar
vi
Occasional Contributor
9 years ago

Reading from excel based on a condition

Hi,

  i have scenario like i have an external excel file which contains TestcaseId,Inputdata1,Inputdata2.

 

i want to read the data from excel where testcase matches and get the inputdata corresponding to that testcases and pass thosse input to steps.

 

I have been trying to read from excel using different helper jexcel and other ways and nothing works.

 

Please can some one share the code to read from an excel file

3 Replies

  • SmartBearAmber's avatar
    SmartBearAmber
    SmartBear Alumni (Retired)

    There is no code necessary to bring data into your tests from an Excel spreadsheet.

     

    You'll need to add a DataSource test step. For more information, please see this document.

    • vi's avatar
      vi
      Occasional Contributor

      Hi,

        i was trying this but it doesn't solve the problem.

      i will store all my testcasename and input data in an external excel file.

      whenever i execute a test case i will read the excel file and then look for matching testcase name and get the test data specific to that testcase.

       

      i gone through that document, but it doesn't server the purpose.

      how to i filter or match for the specific test casename in the datasource.

      If you could provide me the detailed steps..that would be great help

    • vi's avatar
      vi
      Occasional Contributor

      i am aware of getting data from the datasoruce. but do you know how to filter the rows from the datasource after getting the all data from the table.