{"id":37024093,"url":"https://github.com/vanillasource/wicket-gatling","last_synced_at":"2026-01-14T02:54:30.177Z","repository":{"id":24333074,"uuid":"27730387","full_name":"vanillasource/wicket-gatling","owner":"vanillasource","description":"Wicket-Gatling Integration","archived":false,"fork":false,"pushed_at":"2014-12-16T16:08:11.000Z","size":224,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-01-11T19:36:06.664Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vanillasource.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-08T19:10:56.000Z","updated_at":"2023-07-26T09:37:00.000Z","dependencies_parsed_at":"2022-08-22T16:30:27.377Z","dependency_job_id":null,"html_url":"https://github.com/vanillasource/wicket-gatling","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/vanillasource/wicket-gatling","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanillasource%2Fwicket-gatling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanillasource%2Fwicket-gatling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanillasource%2Fwicket-gatling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanillasource%2Fwicket-gatling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vanillasource","download_url":"https://codeload.github.com/vanillasource/wicket-gatling/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanillasource%2Fwicket-gatling/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408798,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T02:54:29.497Z","updated_at":"2026-01-14T02:54:30.163Z","avatar_url":"https://github.com/vanillasource.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"Wicket-Gatling Integration\n==========================\n\nLoad testing Wicket-based web applications with the Gatling framework is not easy\nwhen using just out-of-the-box Gatling. This is because stateful Wicket pages\nrewrite URIs every time a page is requested to maintain proper state of the page. They\nmay also use AJAX links, or other tricks to get events back to the components.\n\nUnfortunately Gatling can only comfortably deal with static URIs to build requests, for example:\n\n```scala\nval scenario = scenario(\"Test\")\n    .exec(http(\"Homepage\").get(\"/\"))\n    .exec(http(\"Profile\").get(\"/profile\"))\n```\n\nThis would usually not work in Wicket, since the link to the profile would not be known at\nthe time of writing this scenario. The link itself would be only contained in the requested\nhomepage at runtime.\n\nThis extension to Gatling makes it possible to write this test the following way:\n\n```scala\nval scenario = scenario(\"Test\")\n    .exec(http(\"Homepage\").get(\"/\"))\n    .exec(http(\"Profile\").get(wicketLinkUnder(\"profile-link\")))\n```\n\nThis library enables the scenario to extract relevant dynamically generated URIs automatically \nfrom the previously requested page and use it in the next request.\n\n## Quickstart\n\n### Getting the library\n\nIf you are using Maven, add this dependency to your pom file:\n\n```xml\n\u003cdependency\u003e\n   \u003cgroupId\u003ecom.vanillasource.wicket-gatling\u003c/groupId\u003e\n   \u003cartifactId\u003ewicket-gatling\u003c/artifactId\u003e\n   \u003cversion\u003e1.0.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nIf you are using sbt:\n\n```sbt\nlibraryDependencies += \"com.vanillasource.wicket-gatling\" % \"wicket-gatling\" % \"1.0.1\"\n\n```\n\n### Setting up Wicket\n\nThis library selects Wicket URIs out of the response based on the *wicketpath* attribute set in the\ngenerated HTML. This is not on by default, so you have to enable it for development environments,\nby putting the following code in your Application class:\n\n```java\nif (getConfigurationType() == RuntimeConfigurationType.DEVELOPMENT) {\n   getDebugSettings().setOutputComponentPath(true);\n}\n```\n\n### Setting up the Gatling Configuration\n\nTo enable parsing Wicket URIs from the response HTML the `enableWicketTargets()` method needs to be called on the HTTP Configuration:\n\n```scala\nimport com.vanillasource.wicket.gatling.HttpConfig._\n\nval httpConfig = http\n    .baseURL(url)\n    .enableWicketTargets()\n    ...\n```\n\nIt is important that the `baseURL()` is set before the `enableWicketTargets()` is called.\n\n## Usage\n\nAfter Wicket targets are enabled, you can use the following methods to retrieve Wicket URIs to make a request:\n\n * `wicketLinksUnder(path_fragment)`: Returns a list of links for the given wicket path.\n * `wicketLinkUnder(path_fragment)`: Expects and returns a single URI under the given path.\n * `wicketFormsUnder(path_fragment)`: Returns a list of form URIs for the given wicket path.\n * `wicketFormUnder(path_fragment)`: Expects and returns a single URI under the given path.\n\nCurrently supported link and form types:\n\n * The `Link` component on any tag (support for both direct *href*, and *onclick* variant)\n * `AjaxLink`s\n * Normal Forms with POST to the *action* attribute (can directly submit Form)\n * Forms with `AjaxButton`, in which case both the Form and the Button can be used to submit\n\n### Getting exactly one URI\n\nMethods `wicketLinkUnder()` and `wicketFormUnder()` can be both directly used in `get()` and `post()` methods:\n\n```scala\nval scenario = scenario(\"Test\")\n    .exec(http(\"Homepage\").get(\"/\"))\n    .exec(http(\"Profile\").get(wicketLinkUnder(\"profile-link\")))\n```\n\nIf there is not exactly one URI found, this will cause a Gatling *KO* for the request.\n\n### Selecting from multiple URIs\n\nMethods `wicketLinksUnder()` and `wicketFormsUnder()` both return a list of URIs from which a single URI needs to be selected first, this can be done with the helper method `selectUri()` the following way:\n\n```scala\n...\n   .exec(http(\"Page\").get(wicketLinksUnder(\"list-item\").selectUri(\n       list =\u003e list(rnd.nextInt(list.size)))\n...\n```\nThe `selectUri()` method takes a function `List[String] =\u003e String`.\n\n### Conditional execution\n\nThe `wicketUriExists()` method can be used to do conditional executions in Gatling with the `doIf` execution instruction:\n\n```scala\n...\n   .doIf(wicketUriExists(\"next-page\")) {\n   }\n...\n```\n\n## Wicket path matching\n\nAll methods that take a path fragment match this path fragment against the full wicket path found in the HTML. Wicket paths are build from the *id*s of the wicket components.\n\nA full wicket path matches a path fragment if the path fragment is a subset of the full wicket path in the same order. For example:\n\n * `wicketLinksUnder()`: This call with an empty path fragment will return **all** links from the previous response.\n * `wicketLinksUnder(\"next-page\")`: Will return every link found under any path that has a component with id *next-page* in it.\n * `wicketLinksUnder(\"content\", \"person-list\", \"next-page\")`: With 3 components given, this will return all links found under the component *next-page* that has to be under a component with id *person-list*, that has to be under a component with id *content*.\n \nIt is possible to use Gatling expressions in the path fragment like this:\n\n```scala\n   .exec(http(\"Current Details\")\n       .get(wicketLinkUnder(\"person-table\", \"detail-link${currentPersonIndex}\")))\n```\n\nThis will substitute the session variable *currentPersonIndex* into the path fragment.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanillasource%2Fwicket-gatling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvanillasource%2Fwicket-gatling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanillasource%2Fwicket-gatling/lists"}