2012-12-17 39 views
0

大家好我有一个疑问,请在具有TestNG中的这个测试代码中,我要登录这个如何重复TestNG中的一个特定的测试方法,它是在一个其他测试方法depent

IM帮助 - >找到该产品组合 - >填写表格

的代码是这样的

@Test 
public static void login(){ 

// login code 

} 

@Test(dependsOnMethod = "login") 
pubilc find_combination(){ 

// finding code 

} 

@Test(dependsOnMethod = "find_combination") 
public static void fill_form(){ 

// filling the product form 

} 
在此

我要重复的find_combination和fill_form,这样我可以用于测试 我谷歌创造更多的产品要求,并发现@测试('invocati onCount = 10' ),将重复的测试方法,但我的问题是,我想执行登录一次 以及使用重复第二和第三测试方法10时任何人都可以帮我请...即时的Eclipse

谢谢你

回答

3

你可以把你的登录inClass。这样它将只对您班级中的所有测试执行一次。如果登录失败,那么你的测试不会被执行。在测试中保持调用计数。

+0

嗨,谢谢niharika_neo – selva

相关问题