How do you fetch the data from the excel



How do you fetch the data from the excel..

Answer / govind

1.To get data fr excel sheet first we need to configure our selenium project with Apache pai jar file

2. Then we have to create execl sheet
3. Then we have to create object of Fileinpuststream class that accept path of execel sheet file.also return type Is file and we have store in one variable

4. After that we have to use create method to open excel sheet which is present in workboofactory class

Workboofactory.create(file)

5.now to navigate for specific sheet present in Excel we use getsheet method which accept string value that is name of sheet
Workbookfactory.create(file).getsheet("sheet name")

6.after that from which row you want data we have to navigate to that row by function getrow.

7. After that you have to navigate to column using function getcell
So finally depending upon type of data present in Excel we use
1.String cell value for stringdata
2. Neroc sell value data
3.boolean cell value da🙏🙏🙏🙏🙏🙏

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Selenium Interview Questions

How to handle dropdowns in selenium?

0 Answers  


Name an api used for reading and writing data to excel files?

0 Answers  


How you are integrating cucumber feature files with step files?

0 Answers  


What is the difference between setspeed() and sleep() methods?

0 Answers  


How much does selenium license cost per client machine?

0 Answers  






How to insert a start point in selenium ide?

0 Answers  


Which is the package which is to be imported while working with webdriver?

0 Answers  


Mention different exceptions you had in selenium web driver?

0 Answers  


How recorded command can be edited in ide?

0 Answers  


How testing is better than junit?

0 Answers  


What are some advantages of selenium?

0 Answers  


What are the operating systems supported by selenium webdriver?

0 Answers  


Categories