PragmaticFlow / NBomber.Http

NBomber plugin for defining HTTP scenarios.
Apache License 2.0
34 stars 16 forks source link

Unable to use Step.Create method #28

Closed JaydipBhattacharjee closed 1 year ago

JaydipBhattacharjee commented 1 year ago

Hi, I am unable to use Step.Create method, it is throwing an error "Step does not contain a definition for create", I am trying to build a performance testing framework for our API and I am trying to use various examples scattered around web but I am now stuck on this. I am using Nbomber 4.1.2 and Nbomber.http 4.1.1.I am using Visual Studio 2019

AntyaDev commented 1 year ago

hello, did you try on the latest NBomber v5?

JaydipBhattacharjee commented 1 year ago

Yes, I also tried with that but same result

AntyaDev commented 1 year ago

Hi @JaydipBhattacharjee , NBomber provides only Step.Run but not Step.Create methods. https://nbomber.com/docs/using-nbomber/basic-api/step#step-run

JaydipBhattacharjee commented 1 year ago

Interesting, was it available with earlier versions of Nbomber? sources from the web lists step.create

https://wil-rees.medium.com/net-load-testing-with-nbomber-170b6dbcfb71 https://www.the-koi.com/projects/nbomber-load-testing-ship-with-confidence-robust-stress-tested-apis/ https://slothycode.com/load-testing-with-c-and-nbomber/ https://pankajrawat.hashnode.dev/api-load-testing-using-c-nbomber

even in your blog

https://nbomber.com/blog/

let step = Step.create("step", fun context -> task {

// invocation count of the current step 
// (will be incremented on each invocation)
context.InvocationCount // int

return Response.ok()

})

My scenario is I want to create multiple steps within a scenario so that all the step results can be show in a single results page. Thank you or having a look.

JaydipBhattacharjee commented 1 year ago

Ok I am trying around with your example but I am facing the below error

System.TypeLoadException: 'Could not load type 'NBomber.CSharp.Scenario' from assembly 'Nbomber, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.'

AntyaDev commented 1 year ago

I think you could just download the examples project and run it https://github.com/PragmaticFlow/NBomber/tree/dev/examples/CSharpProd

here you an find many examples: https://github.com/PragmaticFlow/NBomber/blob/dev/examples/CSharpProd/Program.cs

JaydipBhattacharjee commented 1 year ago

Thanks a ton, it was really helpful.