Stats: Visual Studio 2015 C# Selenium Webdriver 2.53.1 Internet Explorer 11
Trying to add the Method Names to my reporting for clarity. I am using
MethodBase m = System.Reflection.MethodBase.GetCurrentMethod();
I then call
m.Name
expecting to see the method name but instead in my reporting it calls ".ctor()"
Any advice on how to call the actual method name instead?
ctor()
is the default constructor for a class. That means you are callingGetCurrentMethod()
while the class you are calling it from is still being constructed.You might also want to get the class name (see here):