Tag: testng eclipse

如何使用Selenium WebDriver TestNG数据提供者方法从Excel工作表读取特定值?

以下是代码: – package sanityTests; import java.io.File; import java.io.IOException; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.Assert; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import jxl.Cell; import jxl.Sheet; import jxl.Workbook; import jxl.read.biff.BiffException; public class DataDrivenTest2 { @Test (dataProvider= "testdata") //attribute public void add(String x , String y){ int a= Integer.parseInt(x); //Convert String to integer int b = Integer.parseInt(y); int […]