Loading...
「ツール」は右上に移動しました。
利用したサーバー: natural-voltaic-titanium
36いいね 1366回再生

37# How to Read Excel in Selenium using Apache POI II Selenium Automation

In this session you will learning how to Read from Excel in Selenium using Apache POI. In easy way.

Link to GitHub Repository to get the code for practise
github.com/knowledgeshare-technologies/framework-p…

Please join Facebook Group from below link
www.facebook.com/groups/4754296501308288/

If you want to join What's app Group for Selenium Automation Discussion please leave a comment

For all other links , please scroll to the end

*********************************************
Example Program for your practice
*********************************************
package excelRead_Write;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

public class ReadExcel {

public static void main(String[] args) throws IOException
{
File file=new File(System.getProperty("user.dir") + "\\TestData\\" + "Regression_TestData" + ".xlsx");
FileInputStream inputstream=new FileInputStream(file);

XSSFWorkbook wb=new XSSFWorkbook(inputstream);
XSSFSheet sheet=wb.getSheet("LoginDetails");
XSSFRow row=sheet.getRow(2);
XSSFCell cell=row.getCell(0); // Get 1st username

String username=cell.getStringCellValue();
System.out.println("User Name is : " + username );

cell=row.getCell(1);

String password=cell.getStringCellValue();
System.out.println("Password is : " + password );

// driver.findElemnt(by.xpath("ajsdkjas")).sendKeys(username));


}

}

**************************************
Important Playlists and Links below
**************************************
GitHub Repository link for basic Selenium programs for practise
github.com/knowledgeshare-technologies/SeleniumBas…

Please check below Playlist for your easy Learning

Step-by-Step Selenium Learning Playlist
   • Selenium  

Module-wise Learning Playlist for Selenium

Selenium Module - 1 Playlist
   • Selenium - Module_1  

Selenium Module - 2 Playlist
   • Selenium - Module_2  

Selenium Module - 3 Playlist
   • Selenium - Module_3  

Selenium Module - 4 Playlist
   • Selenium - Module_4  

Selenium Module - 5 Playlist
   • Selenium - Module_5  

Selenium Module - 6 Playlist
   • Selenium - Module_6  

Selenium Module - 7 Playlist
   • Selenium - Module_7  

Selenium Module - 8 Playlist
   • Selenium - Module_8  

Framework Pre-requisites
   • Framework Pre-requisites  

Core Java Basic Concepts Playlist
   • Core Java  

OOPS Concepts Playlist
   • OOPS Concepts in Java  

コメント