TestNG使用excel进行数据驱动代码

【Jenkins】testng+Allure显示测试报告截图和测试步骤 简介:总结在Jenkins打开的Allure测试报告里怎么添加失败用例截图和测试步骤。Jenkins配置Allure参考我的另一篇博客:https://blog.youkuaiyun.com/galen2016/article/details/88015322 技术栈: Java maven testng selenium Jenkins Allure pom.xml配置 <properties>... 阅读详情

数据驱动测试

自动化功能测试的一个主要好处是能够快速测试系统上的大量数据。但您必须能够操作数据集,执行计算,并以最少的工作量快速创建数百个测试迭代和排列。测试自动化框架必须具有与电子表格集成的功能,并提供强大的计算功能。

 

Apache POI(Excel)

市场上大多数商业自动化软件工具都支持某种数据驱动测试,它允许您使用不同的输入和验证值自动运行测试用例多次。由于Selenium Webdriver更像是一个自动化测试框架,而不是一个现成的工具,因此您必须付出一些努力来支持自动化测试中的数据驱动测试。我通常更喜欢使用Microsoft Excel作为存储我的参数的格式。使用Excel的另一个好处是,您可以轻松地将测试数据管理外包给除您自己之外的其他人,可能更好地了解需要运行的测试用例以及执行这些测试用例所需的参数。

TestNG数据提供商

当您需要传递需要从Java创建的复杂参数或参数(复杂对象,从属性文件或数据库中读取的对象等)时,在这种情况下,可以使用Dataproviders传递参数。数据提供程序是使用@DataProvider注释的方法。数据提供程序返回一个对象数组。

让我们看一下使用Data Providers with Excel数据表的相同登录示例。

怎么做…

在这里,我们将按照一个简单的步骤流程来实现使用TestNg数据提供程序实现Excel。

步骤1:使用TestNG Data Provider创建Login Application的测试用例。

第2步:   创建测试数据表。

第3步:创建从Excel打开和读取数据的功能

步骤4:创建一个TestNg测试用例,用于使用Data Provider从Excel接受数据。

步骤5:针对Test Data文件中的Test Case名称运行测试。

 

步骤1:使用TestNG Data Provider创建LogIn Application的测试用例

1)按Ctrl + N创建TestNG类'DataProviderTest',在TestNG类别下选择'Create TestNG Class',在Under Annotations下,选中'DataProvider'并单击Finish。

2)默认情况下,DataProvider名称为“dp”,将其更改为“Authentication”。此方法返回对象数组的数组。

3)将方法Registration_data()添加到Test类。此方法将两个字符串作为输入参数。

4)在方法@Test下编写LogIn Application的脚本。

测试用例如下所示:

 

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

package automationFramework;

 

import java.util.concurrent.TimeUnit;

 

import org.openqa.selenium.By;

 

import org.openqa.selenium.WebDriver;

 

import org.openqa.selenium.firefox.FirefoxDriver;

 

import org.testng.annotations.DataProvider;

 

import org.testng.annotations.Test;

 

public class DataProviderTest {

 

    private static WebDriver driver;

 

  @DataProvider(name = "Authentication")

 

  public static Object[][] credentials() {

 

        // The number of times data is repeated, test will be executed the same no. of times

 

        // Here it will execute two times

 

        return new Object[][] { { "testuser_1", "Test@123" }, { "testuser_1", "Test@123" }};

 

  }

 

  // Here we are calling the Data Provider object with its Name

 

  @Test(dataProvider = "Authentication")

 

  public void test(String sUsername, String sPassword) {

 

      driver = new FirefoxDriver();

 

      driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

 

      driver.get("http://www.store.demoqa.com");

 

      driver.findElement(By.xpath(".//*[@id='account']/a")).click();

 

      // Argument passed will be used here as String Variable

 

      driver.findElement(By.id("log")).sendKeys(sUsername);

 

      driver.findElement(By.id("pwd")).sendKeys(sPassword);

 

      driver.findElement(By.id("login")).click();

 

      driver.findElement(By.xpath(".//*[@id='account_logout']/a")).click();

 

      driver.quit();

 

  }

 

}

 

第2步:创建测试数据表

1)创建一个' New Package '文件并将其命名为' testData' ,右键单击Project并选择  New  >  Package 。我总是将我的测试数据文件放在单独的测试数据文件夹中。

 

2)将 Excel  文件放在上面创建的包位置中,并将其另存为 TestData.xlsx 。在excel中填写数据,如下图所示:

使用Excel的TestNG数据提供程序

 

 

第3步:创建从Excel打开和读取数据的功能

我们需要一种方法来打开这个Excel工作表,并在我们的Selenium测试脚本中从中读取数据。为此,我使用Apache POI库,它允许您使用Java读取,创建和编辑Microsoft Office文档。我们将用于从Excel工作表中读取数据的类和方法位于org.apache.poi.hssf.usermodel包中。

要查看设置Apache POI Excel的分步过程,请访问Data Driven Framework。

 

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

package utility;

 

        import java.io.FileInputStream;

 

import java.io.FileNotFoundException;

 

import java.io.FileOutputStream;

 

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 ExcelUtils {

 

private static XSSFSheet ExcelWSheet;

 

private static XSSFWorkbook ExcelWBook;

 

private static XSSFCell Cell;

 

private static XSSFRow Row;

 

public static Object[][] getTableArray(String FilePath, String SheetName) throws Exception {  

 

   String[][] tabArray = null;

 

   try {

 

   FileInputStream ExcelFile = new FileInputStream(FilePath);

 

   // Access the required test data sheet

 

   ExcelWBook = new XSSFWorkbook(ExcelFile);

 

   ExcelWSheet = ExcelWBook.getSheet(SheetName);

 

   int startRow = 1;

 

   int startCol = 1;

 

   int ci,cj;

 

   int totalRows = ExcelWSheet.getLastRowNum();

 

   // you can write a function as well to get Column count

 

   int totalCols = 2;

 

   tabArray=new String[totalRows][totalCols];

 

   ci=0;

 

   for (int i=startRow;i<=totalRows;i++, ci++) {             

 

  cj=0;

 

   for (int j=startCol;j<=totalCols;j++, cj++){

 

   tabArray[ci][cj]=getCellData(i,j);

 

   System.out.println(tabArray[ci][cj]);  

 

}

 

}

 

}

 

catch (FileNotFoundException e){

 

System.out.println("Could not read the Excel sheet");

 

e.printStackTrace();

 

}

 

catch (IOException e){

 

System.out.println("Could not read the Excel sheet");

 

e.printStackTrace();

 

}

 

return(tabArray);

 

}

 

public static String getCellData(int RowNum, int ColNum) throws Exception {

 

try{

 

Cell = ExcelWSheet.getRow(RowNum).getCell(ColNum);

 

int dataType = Cell.getCellType();

 

if  (dataType == 3) {

 

return "";

 

}else{

 

String CellData = Cell.getStringCellValue();

 

return CellData;

 

}catch (Exception e){

 

System.out.println(e.getMessage());

 

throw (e);

 

}

 

}

 

}

 

步骤4:创建一个TestNg测试用例,用于使用Data Provider从Excel接受数据

1)按Ctrl + N创建TestNG类'DataProviderWithExcel',在TestNG类别下选择' Create TestNG Class ',在Under Annotations下,选中' @BeforeMethod ',' @ AfterMethod '和' DataProvider ',然后单击Finish。

3)将方法Registration_data()添加到Test类。此方法将两个字符串作为输入参数。

4)现在将测试用例分为三部分:

@BeforeMethod:启动Firefox并将其指向基本URL

@Test:输入登录用户名和密码,打印控制台消息并注销

@AfterMethod:关闭Firefox浏览器

测试用例如下所示:

 

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

package practiceTestCases;

 

import java.util.concurrent.TimeUnit;

 

import org.openqa.selenium.By;

 

import org.openqa.selenium.WebDriver;

 

import org.openqa.selenium.firefox.FirefoxDriver;

 

import org.testng.annotations.AfterMethod;

 

import org.testng.annotations.BeforeMethod;

 

import org.testng.annotations.Test;

 

import org.testng.annotations.DataProvider;

 

import utility.ExcelUtils;

 

public class DataProviderWithExcel_001 {

 

WebDriver driver;

 

    @BeforeMethod

 

    public void beforeMethod() throws Exception {

 

    driver = new FirefoxDriver();

 

        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

 

        driver.get("http://www.store.demoqa.com");

 

}

 

@Test(dataProvider="Authentication")

 

    public void Registration_data(String sUserName,String sPassword)throws  Exception{

 

        driver.findElement(By.xpath(".//*[@id='account']/a")).click();

 

        driver.findElement(By.id("log")).sendKeys(sUserName);

 

System.out.println(sUserName);

 

        driver.findElement(By.id("pwd")).sendKeys(sPassword);

 

System.out.println(sPassword);

 

        driver.findElement(By.id("login")).click();

 

        System.out.println(" Login Successfully, now it is the time to Log Off buddy.");

 

        driver.findElement(By.xpath(".//*[@id='account_logout']/a")).click();

 

}

 

    @DataProvider

 

    public Object[][] Authentication() throws Exception{

 

         Object[][] testObjArray = ExcelUtils.getTableArray("D://ToolsQA//OnlineStore//src//testData//TestData.xlsx","Sheet1");

 

         return (testObjArray);

 

}

 

    @AfterMethod

 

    public void afterMethod() {

 

       driver.close();

 

     }

 

}

 

注意:此LogIn测试将执行两次,因为数据提供程序Array中有两个用户凭据。

步骤5:针对Test Data文件中的Test Case名称运行测试

1)这意味着您的测试应仅使用针对测试用例名称提及的数据运行一次。为此,我们需要调整Excel实用程序类,还需要添加一些函数来获取当前的测试用例名称和包含测试用例名称的行号。

 

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

package utility;

 

import java.io.FileInputStream;

 

import java.io.FileNotFoundException;

 

import java.io.FileOutputStream;

 

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 ExcelUtils {

 

private static XSSFSheet ExcelWSheet;

 

private static XSSFWorkbook ExcelWBook;

 

private static XSSFCell Cell;

 

private static XSSFRow Row;

 

//This method is to set the File path and to open the Excel file, Pass Excel Path and Sheetname as Arguments to this method

 

public static void setExcelFile(String Path,String SheetName) throws Exception {

 

   try {

 

// Open the Excel file

 

FileInputStream ExcelFile = new FileInputStream(Path);

 

// Access the required test data sheet

 

ExcelWBook = new XSSFWorkbook(ExcelFile);

 

ExcelWSheet = ExcelWBook.getSheet(SheetName);

 

} catch (Exception e){

 

throw (e);

 

}

 

}

 

public static Object[][] getTableArray(String FilePath, String SheetName, int iTestCaseRow)    throws Exception

 

{  

 

   String[][] tabArray = null;

 

   try{

 

   FileInputStream ExcelFile = new FileInputStream(FilePath);

 

   // Access the required test data sheet

 

   ExcelWBook = new XSSFWorkbook(ExcelFile);

 

   ExcelWSheet = ExcelWBook.getSheet(SheetName);

 

   int startCol = 1;

 

   int ci=0,cj=0;

 

   int totalRows = 1;

 

   int totalCols = 2;

 

   tabArray=new String[totalRows][totalCols];

 

   for (int j=startCol;j<=totalCols;j++, cj++)

 

   {

 

   tabArray[ci][cj]=getCellData(iTestCaseRow,j);

 

   System.out.println(tabArray[ci][cj]);

 

   }

 

}

 

catch (FileNotFoundException e)

 

{

 

System.out.println("Could not read the Excel sheet");

 

e.printStackTrace();

 

}

 

catch (IOException e)

 

{

 

System.out.println("Could not read the Excel sheet");

 

e.printStackTrace();

 

}

 

return(tabArray);

 

}

 

//This method is to read the test data from the Excel cell, in this we are passing parameters as Row num and Col num

 

public static String getCellData(int RowNum, int ColNum) throws Exception{

 

   try{

 

  Cell = ExcelWSheet.getRow(RowNum).getCell(ColNum);

 

  String CellData = Cell.getStringCellValue();

 

  return CellData;

 

  }catch (Exception e){

 

return"";

 

}

 

}

 

public static String getTestCaseName(String sTestCase)throws Exception{

 

String value = sTestCase;

 

try{

 

int posi = value.indexOf("@");

 

value = value.substring(0, posi);

 

posi = value.lastIndexOf(".");

 

value = value.substring(posi + 1);

 

return value;

 

}catch (Exception e){

 

throw (e);

 

}

 

}

 

public static int getRowContains(String sTestCaseName, int colNum) throws Exception{

 

int i;

 

try {

 

int rowCount = ExcelUtils.getRowUsed();

 

for ( i=0 ; i<rowCount; i++){

 

if  (ExcelUtils.getCellData(i,colNum).equalsIgnoreCase(sTestCaseName)){

 

break;

 

}

 

}

 

return i;

 

}catch (Exception e){

 

throw(e);

 

}

 

}

 

public static int getRowUsed() throws Exception {

 

try{

 

int RowCount = ExcelWSheet.getLastRowNum();

 

return RowCount;

 

}catch (Exception e){

 

System.out.println(e.getMessage());

 

throw (e);

 

}

 

}

 

}

 

最终测试案例

1)获取测试用例名称。

2)使用测试用例名称,获取测试的Excel工作表的行号。

3)从获取的测试行的excel表中获取数据。

 

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

package practiceTestCases;

 

import java.util.concurrent.TimeUnit;

 

import org.openqa.selenium.By;

 

import org.openqa.selenium.WebDriver;

 

import org.openqa.selenium.firefox.FirefoxDriver;

 

import org.testng.annotations.Test;

 

import org.testng.annotations.BeforeMethod;

 

import org.testng.annotations.AfterMethod;

 

import org.testng.annotations.DataProvider;

 

import utility.ExcelUtils;

 

public class DataProviderWithExcel_002 {

 

private String sTestCaseName;

 

private int iTestCaseRow;

 

WebDriver driver;

 

  @BeforeMethod

 

  public void beforeMethod() throws Exception {

 

  driver = new FirefoxDriver();

 

      driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

 

      driver.get("http://www.store.demoqa.com");

 

  }

 

  @Test(dataProvider = "Authentication")

 

  public void f(String sUserName, String sPassword) {

 

    driver.findElement(By.xpath(".//*[@id='account']/a")).click();

 

    driver.findElement(By.id("log")).sendKeys(sUserName);

 

System.out.println(sUserName);

 

    driver.findElement(By.id("pwd")).sendKeys(sPassword);

 

System.out.println(sPassword);

 

    driver.findElement(By.id("login")).click();

 

    System.out.println(" Login Successfully, now it is the time to Log Off buddy.");

 

    driver.findElement(By.xpath(".//*[@id='account_logout']/a")).click();

 

  }

 

  @AfterMethod

 

  public void afterMethod() {

 

   driver.close();

 

  }

 

  @DataProvider

 

  public Object[][] Authentication() throws Exception{

 

    // Setting up the Test Data Excel file

 

ExcelUtils.setExcelFile("D://ToolsQA//OnlineStore//src//testData//TestData.xlsx","Sheet1");

 

sTestCaseName = this.toString();

 

   // From above method we get long test case name including package and class name etc.

 

   // The below method will refine your test case name, exactly the name use have used

 

   sTestCaseName = ExcelUtils.getTestCaseName(this.toString());

 

    // Fetching the Test Case row number from the Test Data Sheet

 

    // Getting the Test Case name to get the TestCase row from the Test Data Excel sheet

 

iTestCaseRow = ExcelUtils.getRowContains(sTestCaseName,0);

 

    Object[][] testObjArray = ExcelUtils.getTableArray("D://ToolsQA//OnlineStore//src//testData//TestData.xlsx","Sheet1",iTestCaseRow);

 

     return (testObjArray);

 

}

 

}

注意: 这只会针对当前的案例数据执行一次测试。

seleniumWebDriver自动化测试框架_03TestNG和ApachePOIExcel文件数据驱动测试 seleniumWebDriver自动化测试框架_03TestNG和ApachePOIExcel文件数据驱动测试 1.遇到的问题   a.报错信息:FAILED: f java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal   解决方法:maven项目的pom.xml中引入如下依赖包            xml-ap 阅读详情

相关推荐

Selenium WebDriver自动化测试(框架篇):@DataProvider实现数据驱动

TestNG是一个功能强大的Java测试框架,它扩展了JUnit的功能,提供了更多灵活的测试方法。TestNG支持注解、分组、依赖注入等功能,并且内置了数据驱动测试的支持。通过使用TestNG的注解,我们可以很方便地实现数据驱动测试。这种方式将测试数据与测试逻辑分离,提高了测试代码的可读性和可维护性。在实际项目中,我们可以根据需要定义多个数据提供方法,用于提供不同类型的测试数据,以满足不同的测试需求。

我先测了 1143

Java+Excel+POI+testNG基于数据驱动做一个简单的接口测试【杭州多测师_王sir】

一、创建一个apicases.xlsx放入到eclipse的resource里面,然后refresh刷新一下 二、在pom.xml文件中加入poi和testng的mvn repository、然后在eclipse的对应目录下放入features和plugins,重启eclipse就可以看到testNG了 <!--poi excel解析 --> &l...

多测师_王sir的博客 1331

selenium3+java+Maven+TestNG+ReportNG+Excel自动化参数测试框架源码

selenium3+java+Maven+TestNG+ReportNG+Excel自动化参数测试框架源码

TestNG解析Excel,通过Excel驱动测试数据参数化

1.解析Excel: public class ExcelDataProvider implements Iterator<Object[]>{ private Workbook book = null; private Sheet sheet = null; private int rowNum = 0; private int curPhysicalRowNo = 0; private int columnNum = 0; p

renxingzhadan的专栏 617

别再瞎改注册表了!实测Win10/Win11远程桌面60帧的正确姿势(附ToDesk对比)

本文深入解析Windows远程桌面60帧优化的科学方法,揭示常见误区并提供实测有效的解决方案。从版本差异到硬件加速,再到第三方工具对比(如ToDesk),帮助用户避开无效的注册表修改,实现流畅的远程桌面体验。

weixin_33738555的博客 343

RK3588 EVB开发板原理图讲解【六】

该原理图展示了eMMC Flash与主控芯片之间的连接关系,以及相关的电源、信号线路和去耦电容等。

weixin_48721556的博客 1174

【学习笔记】使用testng读取Excel文件数据。执行Excel中的用例

这里写目录标题使用@DataProvider来读取Excel文件的内容1.先读取图中的Excel表中的数据。已二维数组的格式读取出来object[][]2.开始编写testng来判断读取的数据是否正确 使用@DataProvider来读取Excel文件的内容 需要测试的用例是 :判断num1+num2是否等于 num3; 1.先读取图中的Excel表中的数据。已二维数组的格式读取出来object[][] 在testng 中用@dateprovider 的要求是需要提

qq_35564612的博客 1330

ADS SerDes仿真实战:深入解析Tx_Diff均衡器(EQ)参数对眼图质量的影响

本文以ADS仿真平台为基础,深入解析了SerDes设计中Tx_Diff均衡器(EQ)参数对信号完整性的核心影响。通过实战演示,详细对比了去加重(De-emphasis)与FIR抽头系数两种调节模式,揭示了它们如何有效对抗信道损耗与码间干扰,从而显著改善眼图的高度、宽度与抖动性能,为高速串行链路设计提供关键调优思路。

weixin_29230901的博客 227

读取Excel,通过Testng完成数据驱动

背景 数据驱动是我们写自动化脚本非常常用的技术,而Testng中数据驱动常用的注解是 @DataProvider,但是这个方法必须返回一个Object[][]。最近常有学生问起,如果通过外部文件作为数据源,从而实现数据驱动。 例如数据源为Excel时,如何读取excel完成数据驱动呢? 简单思路就是,读取excel数据,excel数据第一行作为map的Key其它行为值,...

dbkahhs97022的博客 594

EtherCAT简介

EtherCAT(EtherNet Control Automation Technology)是由德国公司BECKHOFF公司于2003年提出的实时工业以太网技术。其具有高速、高数据有效率的特点,支持多种设备的连接拓扑结构。从站节点使用专用的控制芯片,例如:microchip公司的Lan9252、BECKHOFF公司的ET1100等ESC(EtherCAT slave controller)芯片。主站的搭建方式有很多,例如:开源主站IGH、SOEM、商业化主站TwinCAT等。

m0_73482095的博客 1万+

知识图谱本体建模工具Protege使用教程

1.下载 先去官网下载:protégé 直接下最新版,点击会有注册页面,只填必填项的name和project description即可。 下载后解压即可使用。 2、安装可视化工具Graphviz 去官网:Download | Graphviz下载。下一个最新版的zip就行。 我解压在了Protege文件夹下,然后在 Preference下指定目录。 指定一下你解压完的Graphviz下的dot.exe,确定。 PS:如果这样报错就尝试在环境变量的系统变量的...

子麒的博客 2万+

testng使用excel进行数据驱动代码参照

import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import

日常记录 1328

手把手教你用TiggerRamDisk绕过iPhone/iPad激活锁(支持iOS16.3,Win/Mac双平台保姆级教程)

本文详细介绍了如何使用TiggerRamDisk工具绕过iPhone/iPad的激活锁,支持iOS16.3系统,并提供Windows和Mac双平台的保姆级教程。从工具准备、设备连接到核心解锁流程,一步步指导用户完成操作,帮助二手设备或旧设备重获新生。

weixin_29323493的博客 916

Excel作为数据源TesTNG做数据驱动完整代码

说明:EXCEL 支持xls 和xlsx 俩种格式 ; 已经过测试 ! 1 package main.java; 2 3 import org.apache.poi.ss.usermodel.*; 4 5 import java.io.File; 6 import java.io.FileInputStream; 7 import java...

weixin_30398227的博客 158

具身智能:原理、算法与系统 第16章 运动控制基础

实时迭代(Real-Time Iteration, RTI)策略在每个采样时刻执行有限次迭代(通常一次),利用相邻时刻解的连续性,在严格时间限制内获得可行解。比例-积分-微分(Proportional-Integral-Derivative, PID)控制是工业界最广泛应用的控制策略,其原理基于误差的当前值(比例)、累积值(积分)与变化率(微分)的线性组合。力-位置混合控制(Hybrid Force/Position Control)将任务空间分解为力控制子空间与位置控制子空间,分别控制。

VectorShift的博客 146

NL2SQL实践系列(1):深入解析Prompt工程在text2sql中的应用技巧

NL2SQL实践系列(1):深入解析Prompt工程在text2sql中的应用技巧

丨汀、的博客 4327

java数据驱动连接excel_Java&Selenium数据驱动【DataProvider+TestNG+Excel】

packagetestNGWithDataDriven;importjava.io.File;importjava.io.FileInputStream;importjava.io.IOException;importjava.util.ArrayList;importjava.util.List;importorg.testng.Assert;importorg.testng.annotatio...

weixin_42513928的博客 385

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

数据驱动测试之—— Excel+TestNG

对于利用Webdriver做自动化的童鞋,对于如何将元素或者输入数据如何和编码分离都应该不会太陌生,本着一边学习一边分享的心态,大概总结了一下关于利用CSV、XML以及Excel来存放数据,然后在结合TestNG来执行数据驱动测试。 需要的Jar包文件: poi-3.11-20141221.jar poi-ooxml-3.11-20141221.jar poi-ooxml-schema...

weixin_30696427的博客 196

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

手把手教你java+selenium数据驱动测试框架搭建与实践

本文主要实现的功能为登录126邮箱,登录成功后,在通讯录中新建联系人,登录邮箱的账号、密码以及新建的联系人的信息都写在Excel文件中,调用Excel文件中的数据,测试用例执行之后并将测试结果写入Excel文件的最后一列。

nhb687095的博客 1240

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

Java用excel做单元测试_java 接口测试,使用excel做数据驱动(二)

改变我们的测试驱动方式,灵活设置测试用例。数据驱动测试数据驱动测试的核心是:测试数据与测试脚本分离,实现测试脚本参数化,提高测试脚本的可重用性。在自动化功能测试中如果灵活使用数据源与测试脚本,便能轻松创建与运行成百上千个测试用例。自动化测试框架必须要有与电子表格、文本文件、数据库集成的能力。首先小伙伴们就会问,你要先解析Excel吧,那你肯定得给我上代码,是的,必须的上代码。packagecom....

weixin_35682224的博客 499

winsocket recv数据读取完成_如何通过Testng完成数据驱动—读取Excel

一、前言数据驱动是我们写自动化脚本非常常用的技术,而Testng中数据驱动常用的注解,如何读取excel完成数据驱动呢? 简单思路就是,读取excel数据,放入map并返回二、Demo1、准备Excel数据2、新建maven工程,并导入 poi相关包<dependency> <groupId>org.apache.poi</groupId>...

weixin_30598353的博客 101

Java+selenium 数据驱动

一、POI+excel数据驱动1、下载poi 的jar包:http://poi.apache.org/download.html(官网)2、编写一个excel命名为test-data.xlsx放在eclipse的drivers目录下;3、上代码:该脚本会运行3次,3次打开浏览器。据说excel的列没有办法统计出来,只能统计行二、Testng+@DataProvider注解数据驱动:...

测试媛 1377
上一篇: 使用TestNG进行多浏览器,跨浏览器和并行测试
下一篇: TestNG参数和数据源
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值