#jjkkll

email.com, jjkkll ;; JH Попытка создать C: Users priya workspace seleniumtopics test-output Default suite Default demo.xml Каталог C: Users priya workspace seleniumtopics test-output Default suite существует: true FAILED: inputdata ("", "1234444") java.lang.NullPointerException пакет pckg2;

import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.IOException;import org.apađậy.poi.ss.usermã sản phẩm.Cell;import org.apabít.poi.ss.usermã sản phẩm.DataFormatter;import org.apabịt.poi.ss.userMã Sản Phẩm.Row;import org.apađậy.poi.ss.userModel.Workbook;import org.apađậy.poi.xssf.userModel.XSSFSheet;import org.apache.poi.xssf.userModel.XSSFWorkbook;import org.openqa.selenium.By;import org.openqa.selenium.WebDriver;import org.openqa.selenium.firefox.FirefoxDriver;import org.openqa.selenium.support.ui.ExpectedConditions;import org.openqa.selenium.support.ui.WebDriverWait;import org.testng.Assert;import org.testng.annotations.BeforeClass;import org.testng.annotations.DataProvider;import org.testng.annotations.Test;public class DataInputfromExcel { public WebDriver driver; public WebDriverWait wait;


Bạn đang xem: #jjkkll

BeforeClass public void setup() System.setProperty("webdriver.firefox.marionette","D:\desktop\Selenium\geckodriver-v0.9.0-arm7hf\geckodriver"); WebDriver driver = new FirefoxDriver(); driver.get("https://mail.google.com"); wait = new WebDriverWait(driver,20); //wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.cssSelector("#account-chooser-add-account")))); //driver.findElement(By.cssSelector("#account-chooser-add-account")).click();


Xem thêm:

Test(dataProvider="login") public void inputdata(String username,String password) System.out.println(username +","+password); wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.cssSelector("#Email")))); driver.findElement(By.cssSelector("#Email")).sendKeys(username); driver.findElement(By.cssSelector("#next")).click(); wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.cssSelector("#Passwd")))); driver.findElement(By.cssSelector("#Passwd")).sendKeys(password); driver.findElement(By.cssSelector("#next")).click(); wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.cssSelector("#errormsg_0_Passwd")))); String errortext=driver.findElement(By.cssSelector("#errormsg_0_Passwd")).getText(); Assert.assertEquals(errortext,"Wrong password. Try again.");


Xem thêm: Why I Can'T I Send Zipped Js Files Via Email? Gmail Will Block

DataProvider(name="login") public Object<><> logindata() throws IOException Object<><> arraydata=getexceldata("C:/Users/priya/Desktop/automationTopics.xlsx","Sheet3"); return arraydata; private String<><> getexceldata(String excelpath, String sheetname) throws IOException { String<><> exceldata=null; try { FileInputStream fs = new FileInputStream(excelpath); XSSFWorkbook wb = new XSSFWorkbook(fs); XSSFSheet sheet= wb.getSheet(sheetname); int rowcount=sheet.getLastRowNum()-sheet.getFirstRowNum(); int colcount=sheet.getRow(0).getLastCellNum(); System.out.println(rowcount +","+colcount); exceldata = new String; for(int i=0;i

Chuyên mục: Mail