一. 在线安装方式
- Eclipse 菜单 Help > Install New software...
- Work with 右边的 Site 下拉列表没有 TestNG
- 点击 Add 按钮,在弹出的 Add Repository 对话框
- Name 输入 TestNG Eclipse Release
- Location 输入 http://dl.bintray.com/testng-team/testng-eclipse-release/
- 点击 Add 按钮
![](https://img.haomeiwen.com/i6887890/5b537f3b6e6e01e8.png)
-
等 Fetching Children 的待进度条走完,中间软件列表对话框出现 TestNG
-
点击软件站点 TestNG 复选框前面的 > 展开详细软件列表,勾选 TestNG,然后点击 Next 按钮
- TestNG
- TestNG M2E (Maven) Integration (Optional)
- TestNG P2 Feature
这一步需要下载一些文件,比较慢
![](https://img.haomeiwen.com/i6887890/9b572e72ca0fba6d.png)
- 在 Install Details 对话框出现 TestNG 的版本,Id 和文件大小,点击 Next 按钮
![](https://img.haomeiwen.com/i6887890/afedbd55231aeb40.png)
- 然后选择接受协议 I accept the terms of the license agreements,再点击 Finish 按钮
![](https://img.haomeiwen.com/i6887890/b120b4af005849da.png)
- Eclipse 右下角有安装软件的进度,出现 Security Warning 对话框点击 Install anyway 按钮
![](https://img.haomeiwen.com/i6887890/4b07dd8ae8a89b22.png)
- 安装完成后跳出 Software Updates 对话框,点击 Restart Now 按钮重启 Eclipse IDE
![](https://img.haomeiwen.com/i6887890/d61a5a40e197ddfe.png)
二. 离线安装方式
- 离线包下载
网址:http://dl.bintray.com/testng-team/testng-eclipse-release/zipped
有各个版本的压缩包,其中最新的 7.3.0 版本下载链接是
http://dl.bintray.com/testng-team/testng-eclipse-release/zipped/7.3.0.202008060412/org.testng.eclipse.updatesite.zip - 关闭 Eclipse
- 压缩包 org.testng.eclipse.updatesite.zip 解压后把 features 和 plugins 目录拷贝到 Eclipse 目录下覆盖
三. 安装后的验证
- 启动 Eclipse
- 新建一个项目
- 项目的右键菜单应该会出现 TestNG,包含 Create TestNG class 和 Covert to TestNG 两个菜单项
网友评论