SvenskaSpel / har2locust

Convert HTTP Archive (.har file) to a Locust script
Other
149 stars 22 forks source link

Template with multiple tagged tasks in separate functions #9

Open arthurzenika opened 7 months ago

arthurzenika commented 7 months ago

A use case I'm looking into would be to split the generated locust file into multiple tasks according to the path detected in the url.

For example I'm browsing on a web application that has multiple modules, for example /todo, /calendar, /news, and I would love to have har2locust generate separate tasks for each "prefix" so that I can launch locust to load tests only one module at a time...

# snip 
    @tag('news')
    @task
    def news(self):
        with self.client.request(
            "GET",
            "/news/latest",
# snip
cyberw commented 7 months ago

Sounds like a cool idea, but would require some work. PRs welcome!