java - How to get Junit class name in another class -


below junit runner need class name runtest in class.

@runwith(cucumber.class) @cucumberoptions(         features = { "src/test/resources/features/automated" },         tags = { "@create_account_without_entering_mandatory_fields", "~@tobeskipped","~@p2" }         , dryrun = false,          monochrome = true,         glue = "tv.nativ.mio.automation.stepdef", plugin = {"html:target/cucumber", "json:target/cucumber/cucumber1.json"})  public class runtest  { } 

i have tried thread.dumpstack() , thread.currentthread().getstacktrace() not getting class runtest in list

i wouldn't recommend that, can remember test class in static variable. in test:

@beforeclass public static void beforeclass() {     // holder class static variable, create     currentclassholder.setclass(runtest.class); } 

you can such thing in every test class , there..


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -