0% found this document useful (0 votes)
6 views

DD database

Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

DD database

Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

package package32;

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

import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;

import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class class32 {

public static void main(String[] args) throws BiffException,


IOException
{
WebDriver d = new FirefoxDriver();
//d.get("http://www.brm.tremplintech.in/web_pages/login.aspx");

FileInputStream fis = new FileInputStream("C:\\Users\\nantha\\


Desktop\\File.xls");
Workbook wb = Workbook.getWorkbook(fis);
Sheet s = wb.getSheet(0);
int Rowcount = s.getRows();
for(int i=0;i<=Rowcount;i++)
{
d.get("http://www.brm.tremplintech.in/web_pages/login.aspx");
String A = s.getCell(0, i).getContents();
String B = s.getCell(1, i).getContents();
d.findElement(By.xpath(".//*[@id='txt_unam']")).sendKeys(A);
d.findElement(By.xpath(".//*[@id='txt_pass']")).sendKeys(B);
d.findElement(By.xpath(".//*[@id='Button3']")).click();
Alert a = d.switchTo().alert();
a.accept();

}
}

You might also like