Как выполнить один тест от большого комплекта TestNG с помощью testng.xml?

Взгляните на автономное инструмент Subversion Notify (Windows только!) Это может сделать пользование электронной почтой на фиксации и также намного больше!

19
задан Sad Developer 4 November 2009 в 09:31
поделиться

4 ответа

There are several methods to do this.

Are you using Eclipse for development? There is an Eclipse plugin for TestNG and I think it would be by far the easiest way for you to run specific tests. The plugin allows you to run suite, group, class or method of available test.

If not, I believe you can setup an ant task for launching the test(http://testng.org/doc/ant.html) and use attributes like "classfilesetref" to provide a list of test to run. You can specify the test in a separate file so you don't have to update the build.xml every time your run the test.

For installing testng Plugin.Just Follow the steps: 1-Go to "Help" Menu in Eclipse. 2-Select "Install New Software"". 3-Добавьте " http://beust.com/eclipse ."

Он работает в случае указанной вами ошибки. Я думаю, у вас не установлен плагин в среде Eclippse IDE

1
ответ дан 30 November 2019 в 03:29
поделиться

После каждого запуска TestNG создает файл с именем testng-failed.xml, содержащий только тесты, которые не прошли проверку. Просто вызовите TestNG еще раз для этого файла:

java org.testng.TestNG testng.xml java org.testng.TestNG testng-failed.xml

(замените org.testng.TestNG своим собственным бегуном, поскольку кажется, что вы используете индивидуальный).

6
ответ дан 30 November 2019 в 03:29
поделиться

You could also create your own ITestListener (since you've got your own wrapper anyhow) that keeps track of the failures and then from that generate your own failures suite file that contains only the failed test. TestNG's listener/interceptor hooks are pretty good. At work we've extended TestNG using them several ways:

  • capture/playback of generated data sets
  • result logging to a database
  • customized test output (logs)
  • meta data such as IDs, descriptions, for data sets provided by a @DataProvider
  • runtime checks of environment dependent restrictions on test cases
1
ответ дан 30 November 2019 в 03:29
поделиться

Попробуйте следующее:

  <classes>
    <class name="test.IndividualMethodsTest">
      <methods>
        <exclude name="testMethod" />
      </methods>
    </class>
  </classes>
7
ответ дан 30 November 2019 в 03:29
поделиться
Другие вопросы по тегам:

Похожие вопросы: