Git Product home page Git Product logo

jmeter-dotnet-dsl's People

Contributors

rabelenda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

lagroujl

jmeter-dotnet-dsl's Issues

Backend Listener

Hi Team, awesome work you are doing here.
I have a request for an implementation of the Backend Listener function to send metrics to my InfluxDB (org.apache.jmeter.visualizers.backend.influxdb.HttpMetricsSender).

Cheers
Enrico

Connect to WebSocket/SignalR

Hello!
I have a project and the base workflow starts when a SignalR method is called.
How can I connect to SignalR or Socket?

Setting name for HttpSampler is not working

Setting name for HttpSampler("name","url") is not being picked up. All the requests are being recorded under label "Https request". In azure load test , the only sampler name displayed is "Http Request"

Error when trying to execute a simple test using a CSV file and Azure Load Testing

Hello, I have simple load test like this:

[Fact]
public void Ping10Times()
{
    var configuration = new ConfigurationBuilder()
                                   .SetBasePath(Directory.GetCurrentDirectory())
                                   .AddJsonFile("appsettings.json")
                                   .AddUserSecrets<LfraileNetTests>()
                                   .AddEnvironmentVariables()
                                   .Build();
    var stats = TestPlan(
        CsvDataSet("urls.csv")
        .SharedIn(Abstracta.JmeterDsl.Core.Configs.DslCsvDataSet.Sharing.Thread),
        ThreadGroup(1, 10,
        HttpSampler("https://www.lfraile.net/${url}")
        ),
        JtlWriter("jtls")
    )
    .RunIn(
        new AzureEngine(
            tenantId: configuration["LoadTesting:TenantId"],
            clientId: configuration["LoadTesting:ClientId"],
            clientSecret: configuration["LoadTesting:ClientSecret"])
    .TestName("lfloadtestsdemo")
    .SubscriptionId(configuration["LoadTesting:SubscriptionId"])
    .TestResourceName(configuration["LoadTesting:TestResourceName"])
    .ResourceGroupName(configuration["LoadTesting:TestResourceGroup"])
    .Engines(1)
    .TestTimeout(TimeSpan.FromMinutes(5)));
    Assert.True(stats.Overall.Errors.Total == 0);
    Assert.True(stats.Overall.SampleTimePercentile99 < TimeSpan.FromSeconds(5));
}

And the "urls.csv":

url
2019/03/03/environment-variables-and-azure-pipelines/
2019/03/09/opinion-what-and-why-yaml-azure-pipelines/
2019/03/30/some-ideas-on-feature-flags/

And when I try to run it, locally or even for example with GitHub Actions, I always get this error:

[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.5.7+8f2703126a (64-bit .NET 8.0.2)
[xUnit.net 00:00:00.05]   Starting:    PoC.LoadTest.Dsl
[xUnit.net 00:00:02.16]     PoC.LoadTest.Dsl.LfraileNetTests.Ping10Times [FAIL]
[xUnit.net 00:00:02.16]       Abstracta.JmeterDsl.Core.Bridge.JvmException : JVM execution failed. Check stderr and stdout for additional info.
[xUnit.net 00:00:02.16]       Stack Trace:
[xUnit.net 00:00:02.16]            at Abstracta.JmeterDsl.Core.Bridge.BridgeService.WaitJvmProcessExit(Process process)
[xUnit.net 00:00:02.16]            at Abstracta.JmeterDsl.Core.Bridge.BridgeService.RunBridgeCommand(String command, Object testElement, String args)
[xUnit.net 00:00:02.16]            at Abstracta.JmeterDsl.Core.Bridge.BridgeService.RunTestPlanInEngine(DslTestPlan testPlan, IDslJmeterEngine engine)
[xUnit.net 00:00:02.16]            at Abstracta.JmeterDsl.Core.Engines.BaseJmeterEngine`1.Run(DslTestPlan testPlan)
[xUnit.net 00:00:02.16]            at Abstracta.JmeterDsl.Core.DslTestPlan.RunIn(IDslJmeterEngine engine)
[xUnit.net 00:00:02.16]         C:\ws\lfraileorg\jmeter-dsl-net\PoC.LoadTest.Dsl\LfraileNetTests.cs(18,0): at PoC.LoadTest.Dsl.LfraileNetTests.Ping10Times()
[xUnit.net 00:00:02.16]            at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
[xUnit.net 00:00:02.16]            at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
[xUnit.net 00:00:02.17]   Finished:    PoC.LoadTest.Dsl

If I run the test without Azure Load Testing involved (Just a simple .Run() ) it works perfectly, or if I try tu run the test in Azure Load Testing but without the CSV file.

Is this supported?, Thank you!

Getting System.InvalidOperationException when running test plan - .Net Framework Library

Code:
var stats = TestPlan(
ThreadGroup(noOfThreads, noOfIterations,
HttpSampler(uri).Method(method)
)
).Run();

System.InvalidOperationException: 'The Process object must have the UseShellExecute property set to false in order to redirect IO streams.'

Message:
Test method RestApiTestProject.RestApiTest.TestApiPerformance threw exception:
System.InvalidOperationException: The Process object must have the UseShellExecute property set to false in order to redirect IO streams.

Stack Trace:
Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
Process.Start()
BridgeService.StartJvmProcess(String jvmArgs)
BridgeService.RunBridgeCommand(String command, Object testElement, String args)
BridgeService.RunTestPlanInEngine(DslTestPlan testPlan, IDslJmeterEngine engine)
BaseJmeterEngine`1.Run(DslTestPlan testPlan)
DslTestPlan.Run()

`Perc99` lower than `Perc95` and `Perc90`

I encountered a problem, it occasionally happens that Perc99 is smaller than Perc95 and Perc90. How is this possible and why does it happen?

Here is serialized StatsSummary object with threads and iterations info:

{
  "Threads": 100,
  "Iterations": 100,
  "FirstTime": "2023-12-07T17:35:01.284Z",
  "EndTime": "2023-12-07T17:36:21.07Z",
  "Samples": { "Total": 10000, "PerSecond": 125.33527185220464 },
  "SampleTime": {
    "Min": "00:00:00.0430000",
    "Max": "00:00:05.8470000",
    "Mean": "00:00:00.7750000",
    "Median": "00:00:00.8580000",
    "Perc90": "00:00:02.4550000",
    "Perc95": "00:00:02.7660000",
    "Perc99": "00:00:01.6390000"
  },
  "ErrorsCount": 0,
  "SampleTimePercentile99": "00:00:01.6390000",
  "ReceivedBytes": { "Total": 3770000, "PerSecond": 47251.39748828115 },
  "SentBytes": { "Total": 4890000, "PerSecond": 61288.94793572807 }
}

Incorporate functionality to verify the expected response.

Hello Team
I have a substantial scenarios where I need to execute multiple POST, GET, and PUT requests. I've observed that in JMeter Java-based, we can assert both the response and JSON response.

Please below sample tests
`

    private const string BaseUrl = "https://your-api.com";


    [Test]
    public void ClientCredentialsFlowLoadTests()
    {

        var stats = TestPlan(
            CsvDataSet("users.csv"),
            HttpCookies().Disable(),
            HttpCache().Disable(),
            ThreadGroup(3, 10,
                HttpSampler("Client Credentials Flow", BaseUrl)
                    .Method(HttpMethod.Post.Method)
                    .ContentType(new System.Net.Http.Headers.MediaTypeHeaderValue(MediaTypeNames.Application.FormUrlEncoded))
                    .Param("grant_type", "client_credentials")
                    .Param("client_id", "${clientId}")
                    .Param("client_secret", "${clientSecret}")
                    .Param("scope", "${scope}")
            ).Children(
                    RegexExtractor("ACCESS_TOKEN", "accessToken=(.*)")
                ),
             ResponseFileSaver(DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss").Replace(":", "-") + "-response")
        ).Run();

        Assert.That(stats.Overall.SampleTimePercentile99, Is.LessThan(TimeSpan.FromSeconds(20)));
    }

`

Within my code, I aim to:

  1. Validate the response status.
  2. Retrieve my access token and validate its contents.
  3. Although unrelated to the aforementioned code, I have additional scenarios where I intend to introduce pauses between requests, as illustrated in this resource: https://abstracta.github.io/jmeter-java-dsl/guide/#emulate-user-delays-between-requests

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.