如何使用Eclipse创建'testng.xml' [英] How to create 'testng.xml' using Eclipse

查看:514
本文介绍了如何使用Eclipse创建'testng.xml'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是TestNG和Selenium Webdriver的新手,并尝试使用eclipse创建一个testng.xml。

I am new to TestNG and Selenium Webdriver and trying to create a testng.xml using eclipse.

在www中进行一些研究,并了解该文件可以被创建通过做右键点击Java类>> TestNG >>转换为TestNG

Done some research in www and understand that this file can be created by doing Right Click on the Java class >> TestNG >> Convert to TestNG

但是这个Convert Refactoring向导没有打开。

However this Convert Refactoring wizard is not opening.

如果Java类已经包含@Test注释(!?),这个向导是否不会打开。

Whether this wizard will not open, if the Java class already contains @Test annotations (!?)

可以帮助我创建testng.xml吗eclipse请。

Can you help me to create testng.xml using eclipse please.

(我正在使用Eclipse Luna)

(I am using Eclipse Luna)

推荐答案

手动创建testng套件文件如下:

Created testng suite file manually as below:


  1. 运行一次您的项目

  2. 刷新您的项目

  3. 现在,test-output文件夹将在您的项目下创建 - 展开文件夹

  4. 双击index.html文件;它将在Eclipse浏览器窗口中打开

  5. 单击左侧面板上给出的.xml链接

  6. 测试套件XML将获得在右侧面板上打开

  7. 获取XML内容的副本

  8. 右键单击您的项目>>新建>>文件

  9. 提供测试套件文件的名称(with.xml扩展名,例如testng.xml),然后单击完成

  10. 将您从index.html复制的内容粘贴'并根据您的需要修改您的套件文件

  1. Run once your project
  2. Refresh your project
  3. Now, "test-output" folder will get created under your project – unfold the folder
  4. Double click the ‘index.html’ file; it will get open in the Eclipse Browser window
  5. Click on the ‘.xml’ link given on the left panel
  6. The test suite XML will get opened on the right-side panel
  7. Take a copy of the XML content
  8. Right click your project >> New >> File
  9. Give name of your test suite file (with.xml extension e.g. testng.xml) and click finish
  10. Paste the content that you copied from the ‘index.html’ and amend your suite file as per your needs

这篇关于如何使用Eclipse创建'testng.xml'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆