241K Views

Creating ,Updating and Deleting Excel Workbook and Sheet By Selenium

After a long discussion in Data Driven frameworks in Selenium:

We know about how we can pass parameters from excel sheet to our program by selenium. But in this article we will know about how user can create a excel workbook and sheet by selenium.

Write data to excel using column name will discuss about how we write test data/test results to the excel sheet while automating any application using selenium web driver. We might get doubt in mind that why we do it? what is purpose to put test result in excel sheet.

The main reason behind is that if application need so much data, and thousands numbers of data to be feed to test like product creation, we need multiple data at that time i.e price, sku, colour, brand…. etc.  So we will manage those data using external sources like test file, XML file, and excel file…..etc.

Among those excel is user friendly we can organize the data very easily, we can read and write data how we want. so we mostly use excel to manage our data.

Creating a New Work Book

By Run as java application a file created as below :

Creating a New Sheet

Output results

A new excelsheet with name Test.xls is created with Sheet name as “sheet1”, “sheet2”, “sheet3”.

 

Creating  Cells

Ouput Results:

Insert extra cells or overwrite cells

Output Result

Deleting cell

 Output Results:

 

Category(s) Uncategorized
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


3 comments

  • Fede
    Excelent aport
    thanks
    • Himani Gupta
      Hello Fede
      Many thanks for reading and appreciation.
      Keep staying with us!!
      Thanks & Regards
      UVdesk Team
  • abdul
    Simple but Detailed.Thank you
  • css.php