Programmatically adding custom tests in ide testng app

Hi. I want setup tests myself (programmatically), but using built-in testng runner, not throught standart main app (uninformative small console report instead of pretty graphics). How i can inject my tests on-the-fly while runner starts (exec something like this)? Thx :)

5 comments
Comment actions Permalink

Спс :) Ещё небольшой вопрос. На данный момент иерархия тестировочных модулей такова: org.wenny.tests.Chrome:v31 (метод). Соответственно, и в логах имеем методы, где @Test поставили. Однако, конфигурации могут быть разные, а движок - один. Можно как-то вывод поправить? Например, чтобы вывод в консоль стал такой: org.wenny.site1.tests.Chrome:v31. Спасибо.

0
Comment actions Permalink

Not sure that I understand the question, but still. Why not using data providers:
{code}

 
@DataProvider
public Object[][] data() {
  return new Object[][]{{"param1"}, etc};
}
 
@Test(dataProvider = "data")
 
public void doTest(final String name) throws Exception {}

{code}

then you'll be able to print whatever you need and test presentation in the tree would depend on your parameters (for details please check testng documentation/sources)

Thanks

0
Comment actions Permalink

Can i set specific methods similarly?

0
Comment actions Permalink

which methods do you mean? doTest in my example is a test method

0

Please sign in to leave a comment.