I have a test suite written up in Java using Selenium-RC and TestNG, per -
public class testSuite extends SelenestTestCase {
@BeforeTest
...
@Test
...
@Test
...
@AfterTest
...
To improve robustness, I need to implement a set of steps that would be executed in case any of the commands within a @Test
fails. These steps could simply be the restoration of the initial test state, so the next @Test
can be executed.
Any ideas on how this can be 开发者_高级运维implemented within this framework?
Thanks.
You can implement your own test listener and annotate your test class. Or just use @BeforeMethod and set the initial state before each test.
精彩评论