Nice video, works for me. One question - how can I get the steps to show the correct number as you have 6 steps in your scenario but the current implementation shows only 1 step in the report? You seem to assign step = scenario in the [BeforeStep] hook which I think causes this. I would like the report to show 6 steps. Many Thanks
Hi, on my side Im getting this exception what could be the problem please help Im busy with work project : OneTimeSetUp: BoDi.ObjectContainerException : Multiple public constructors with same maximum parameter count are not supported! System.Globalization.CultureInfo (resolution path: TechTalk.SpecFlow.FeatureContext->TechTalk.SpecFlow.FeatureInfo)
@Omuhle Mazibuko, looks like you're passing incorrect parameter into to the Specflow hooks methods. Please check if parameters are correct on all the hook methods. E.g. [BeforeScenario] public void BeforeScenario(Context context)
Hi. I used same exactly : static string reportPath = System.IO.Directory.GetParent(@"../../../").FullName + Path.DirectorySeparatorChar + "Reports" + Path.DirectorySeparatorChar + "Report_" + DateTime.Now.ToString("ddMMyyyy HHmmss"); But I only get the 'Reports' folder and index.html file in this folder. I'm using Selenium C# Please help. Thank you.
Hi ,I have implemented extentReport however getting error while executing the script through command prompt and same script is working fine via visual studio please help why this happening.
Actually i got the issue why it is coming actually one peace of code showing error. in case i am using this file path getting error : //static string configSettingPath=System.IO.Directory.GetParent(@"../../../").FullName + // Path.DirectorySeparatorChar + "Config/configsetting.json";
Okay. It's because System.IO.Directory returns the current working directory. IF you run it through VS then it returns different value. But when you run it through cmd prompt, then might be you are using some different location. Please make sure you are running the script from correct location.
public static void BeforeFeature(FeatureContext context1) | BeforeScenarion(ScenarioContext context2) | AfterStep(ScenarioContext context3) this is how it looks on my side axactly as your video
subfolder is not created inside Report folder did I miss some thing ? [Binding] public class Hooks { static AventStack.ExtentReports.ExtentReports extent; static AventStack.ExtentReports.ExtentTest feature; static AventStack.ExtentReports.ExtentTest scenario,step; static string reportpath = System.IO.Directory.GetParent(@"../../../").FullName + Path.DirectorySeparatorChar + "Result" + Path.DirectorySeparatorChar + "Result_" + DateTime.Now.ToString("ddMMyyyy HHmmss"); [BeforeTestRun] public static void BeforeTestRun() {
THank you Thank you Thank you, I got it right this was helpful for first time I managed to create extent report very simple
Glad to know. 😊
How we can replace the default extent logo with companies logo
You can customise the extentreport.config and change the logo file path. Then use the same file while initialising the extent report.
@@maximumautomationCould you please explain in any videos so it could help people
I hope this is gonna help you.
ua-cam.com/video/6inO_Jf_TJY/v-deo.html
Nice video, works for me. One question - how can I get the steps to show the correct number as you have 6 steps in your scenario but the current implementation shows only 1 step in the report? You seem to assign step = scenario in the [BeforeStep] hook which I think causes this. I would like the report to show 6 steps. Many Thanks
This is the limitation from extext report. It identify feature file as test and scenarios as steps.
Hi, on my side Im getting this exception what could be the problem please help Im busy with work project : OneTimeSetUp: BoDi.ObjectContainerException : Multiple public constructors with same maximum parameter count are not supported! System.Globalization.CultureInfo (resolution path: TechTalk.SpecFlow.FeatureContext->TechTalk.SpecFlow.FeatureInfo)
@Omuhle Mazibuko, looks like you're passing incorrect parameter into to the Specflow hooks methods. Please check if parameters are correct on all the hook methods.
E.g.
[BeforeScenario]
public void BeforeScenario(Context context)
thank you for the git code. It helped me so much
You're welcome!
Hi.
I used same exactly :
static string reportPath = System.IO.Directory.GetParent(@"../../../").FullName
+ Path.DirectorySeparatorChar + "Reports"
+ Path.DirectorySeparatorChar + "Report_" + DateTime.Now.ToString("ddMMyyyy HHmmss");
But I only get the 'Reports' folder and index.html file in this folder.
I'm using Selenium C#
Please help. Thank you.
i need help my project dosent works, have any git repository for download this code?
@Vitor
Please see below link for same.
github.com/MaximumAutomation/seleniumnunit
Multiple test cases in one extent report
Hi ,I have implemented extentReport however getting error while executing the script through command prompt and same script is working fine via visual studio please help why this happening.
Are you using dotnet framework or dotnet core? And version?
@@maximumautomation dotnet core
Actually i got the issue why it is coming actually one peace of code showing error. in case i am using this file path getting error : //static string configSettingPath=System.IO.Directory.GetParent(@"../../../").FullName +
// Path.DirectorySeparatorChar + "Config/configsetting.json";
static string logPath = "D:\
ewgit\\SpecflowFramework\\UI_Script\\Result"; :--- it is working fine
Okay. It's because System.IO.Directory returns the current working directory. IF you run it through VS then it returns different value.
But when you run it through cmd prompt, then might be you are using some different location. Please make sure you are running the script from correct location.
I got broken ui extent report. Could you please help me how to fix it?
Broken? Sorry I didn't understand.
public static void BeforeFeature(FeatureContext context1) | BeforeScenarion(ScenarioContext context2) | AfterStep(ScenarioContext context3) this is how it looks on my side axactly as your video
Okay. Could you please share Specflow version which you are using?
Is it possible to generate extend report in vscode?
Yes, you can.
How to add screen shot to it
Please watch below video for same.
ua-cam.com/video/bv5yLSDI6H0/v-deo.html
How do i access this video @@maximumautomation
subfolder is not created inside Report folder did I miss some thing ?
[Binding]
public class Hooks
{
static AventStack.ExtentReports.ExtentReports extent;
static AventStack.ExtentReports.ExtentTest feature;
static AventStack.ExtentReports.ExtentTest scenario,step;
static string reportpath = System.IO.Directory.GetParent(@"../../../").FullName
+ Path.DirectorySeparatorChar + "Result"
+ Path.DirectorySeparatorChar + "Result_" + DateTime.Now.ToString("ddMMyyyy HHmmss");
[BeforeTestRun]
public static void BeforeTestRun()
{
ExtentHtmlReporter htmlreport = new ExtentHtmlReporter(reportpath);
extent = new AventStack.ExtentReports.ExtentReports();
extent.AttachReporter(htmlreport);
}
[BeforeFeature]
public static void BeforeFeature(FeatureContext context)
{
feature = extent.CreateTest(context.FeatureInfo.Title);
}
[BeforeScenario]
public static void BeforeScenario(ScenarioContext context)
{
scenario = feature.CreateNode(context.ScenarioInfo.Title);
}
[BeforeStep]
public void BeforeStep()
{
step = scenario;
}
[AfterStep]
public void AfterStep(ScenarioContext context)
{
if(context.TestError == null)
{
step.Log(Status.Pass, context.StepContext.StepInfo.Text);
}
else if(context.TestError != null)
{
step.Log(Status.Fail, context.StepContext.StepInfo.Text);
}
}
[AfterFeature]
public static void AfterFeature()
{
extent.Flush();
}
}
Is there any folder which got created?
@@maximumautomation No only result folder inside that direct result it is displaying
Result with date time is not created.
Could you please check what you are getting in variable reportpath while debugging?