如何为Testng创建可执行的jar文件,runnnig点应该是Xml文件 [英] How to create a executable jar file for Testng and the runnnig point should be the Xml file

查看:272
本文介绍了如何为Testng创建可执行的jar文件,runnnig点应该是Xml文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在Eclipse IDE上开发selenium web驱动程序和testng。我通常从我创建的XML文件运行测试,该文件运行eclipse中的所有方法。

I am currently working on the selenium web driver and testng on Eclipse IDE. I usually run the test from the XML file that i have created which runs all the methods in the eclipse.

现在我想创建一个简单的可执行jar,应该做同样的,即它的运行点应该是XML文件,以便每个测试执行。

Now i want to create a simple executable jar which should do the same i.e its running point should be the XML file so that each test is executed .

我正在努力尝试。请给我一些如何进一步的建议。

I am trying hard on this. Please give me some advice on how to go further with it

推荐答案

使用 Eclipse导出向导。导出时,选择创建Runnable Jar并选择项目的入口点(其中包含 main 方法)的类。

Use Eclipse Export Wizard. While exporting, select "Create Runnable Jar" and select the class which is entry point (which contains main method) of your project.

此类将具有 main 方法,它将读取XML并执行测试用例

This class will have main method which will read XML and execute the testcases

这篇关于如何为Testng创建可执行的jar文件,runnnig点应该是Xml文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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