<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, May 9, 2013 at 2:23 PM, Mircea Markus <span dir="ltr">&lt;<a href="mailto:mmarkus@redhat.com" target="_blank">mmarkus@redhat.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On 9 May 2013, at 08:02, Dan Berindei wrote:<br>
<br>
&gt; Why would TestNG run an @AfterMethod method if the test didn&#39;t run?<br>
</div>if you set alwaysRun=true on that method it will run it disregarding if the test was run or not.<br>
<div class="im">&gt; What method would it run after?<br>
</div>not sure i get the question.<br>
<div class="HOEnZb"><div class="h5"><br></div></div></blockquote></div><br></div>A test method is &quot;skipped&quot; only if a dependency of the test failed (e.g. a @BeforeMethod method). A test that&#39;s in a different group may be considered &quot;ignored&quot; or &quot;disabled&quot;, but it&#39;s not &quot;skipped&quot;. Since TestNG is not even trying to run the method, it shouldn&#39;t run any @BeforeMethod/@AfterMethod methods for it either.<br>

<div class="gmail_extra"><br></div><div class="gmail_extra">I wrote a test class with different groups for the test method and each confguration method, and the only configuration methods that ran even with no test method in the default group were @BeforeTest/@AfterTest.<br>

<br></div></div>