ITSourceCode.com

We Exist to Provide 100% Free Source Code and Tutorials

Custom Search

Category: Selenium Tutorial

How to read Excel file using Selenium WebDriver

Below is a basic code on how to read excel file. As per your requirement you can read the data for excel and play around it. < View plain text > java import java.io.File;   import java.io.FileInputStream;   import java.io.IOException;   import org.apache.poi.hssf.usermodel.HSSFWorkbook;   import org.apache.poi.ss.usermodel.Row;   import org.apache.poi.ss.usermodel.Sheet;   import org.apache.poi.ss.usermodel.Workbook;   import org.apache.poi.xssf.usermodel.XSSFWorkbook; […]

How to select a value from a dropdown ?

We can select a value from a dropdown by using WebDriver’s Select class. Syntax: < View plain text > java selectByValue: Select selectByValue = new Select(driver.findElement(By.id(“SelectID_One”))); selectByValue.selectByValue(“greenvalue”);   selectByVisibleText: Select selectByVisibleText = new Select (driver.findElement(By.id(“SelectID_Two”))); selectByVisibleText.selectByVisibleText(“Lime”);   selectByIndex: Select selectByIndex = new Select(driver.findElement(By.id(“SelectID_Three”))); selectByIndex.selectByIndex(2); < View plain text > java public Select(WebElement element) A check […]

Page 1 of 212
ITSourceCode.com © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!