Utility to read excel data based on column name in Selenium Java
Vložit
- čas přidán 4. 09. 2024
- This video will explain, how to create an utility class or methods to
set the excel file path & sheet name
Read the cell data based on String, numeric etc
Read data based on row & column index
Read the data based on column name and row index
Utilise the methods in selenium tests
Apache POI maven dependency -
POI & POI-ooxml
mvnrepository....
Blog - qavalidation.c...
Why we use a constructor to read test data from external sources such as Excel sheets!
Like you mentioned atlast, how to compare value of excel with text present on website?
It's for scriptless test execution.
Thankyou boss
Hi sir, i am getting Cannot invoke "org.apache.poi.xssf.usermodel.XSSFSheet.getRow(int)" because "this.sheet" is null error please suggest what is the issue
Hi ...could you integrating this excel reader into cucumber bdd framework to fetch the test data ...
Hi,
How can I search for header String (location can change but remain in first line with other headers) based on the column string name and then get all the cells beneath?
You need not to worry if you are swapping column names, you can still use same code because we get the index of column names on run time
@@qavbox and how can I get the cells beneath the selected column name ?
Thanks !
@@eyalavramchik8338 create a for loop with no. Of rows excel has data, inside for loop call the getcelldata method with parameters as getcelldata(columnName, index)
HashMap has error :/ public Map columns = new HashMap();
What's the error you getting?
How.to.read.Date type from excel
You can refer to this code block -
github.com/sunilpatro1985/SeleniumJavaFramework/blob/main/src/main/java/base/ExcelReader.java