Focussing on the problem is the problem.

When refining a concept we always hear ‘Focus on the problem you’re trying to solve.’. “Focussing on the problem is the problem.” is published by _sandymanuel in baytree.co.

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




TestNG how to get the Test suite name and conditionally skipping a Test method ?

Suppose I want to get TestNG suite.xml’s name not the actual xml file name (GetSuiteNameExample.xml)

<suite name=”SmokeTestSuite”>

based on that I can perform my actions in the scripts like if it’s running using a test plan and if the name is “SmokeTestSuite” , send email after the execution, and if the automation engineer runs the script directly so no need to send an email and skip that part .

If the class run without a plan the name will be “Default suite”

First let’s look and the test plan GetSuiteNameExample.xml

Now let’s look at the code itself and it’s heavily commented with explanations so please follow it .

Output when running using a Test suite xml

Output when directly run it as a TestNG class

Add a comment

Related posts:

Curbing Abuse of the Americans with Disabilities Act

How the ADA Education and Reform Act of 2017 proposes commonsense fixes to direct more money toward improving access Today, the ADA is being abused by a few bad actors who are serving their personal…