BeforeTest method in single package across different files | Selenium Forum
M
Posted on 01/08/2016
In Package A, there are 2 class files --File A and File B

File A contains:

@BeforeTest ("This is File A before test")
@Test("This is File A Test method")

File B contains:

@BeforeTest ("This is File B before test")
@Test("This is File B Test method")


Now both are executed at same time and output is displayed as below:

"This is File A before test"
"This is File B before test"
"This is File A Test method"
"This is File B Test method"

We thought output would be:

"This is File A before test"
"This is File A Test method"
**********************
"This is File B before test"
"This is File B Test method"



based on this output, can we conclude that all "BeforeTest" functions in different classes will be displayed at the TOP instead of displaying at class level.

which one is correct of above 2?

M
Replied on 02/08/2016

[quote:1lx7tvzz]based on this output, can we conclude that all "BeforeTest" functions in different classes will be displayed at the TOP instead of displaying at class level.[/quote:1lx7tvzz]

@before test runs before the @test. you're seeing it together like that because they're running in parallel.