k6

A modern load testing tool, using Go and JavaScript

"like unit testing, for performance"

k6 is a modern load testing tool, building on Load Impact's years of experience. It provides a clean, approachable JavaScript scripting API, distributed and cloud execution, and orchestration via a REST API.

Get Started    Guides

Selection.find(selector)

Find the selection descendants, filtered by a selector. It returns a Selection object.
Mimic jquery.find

Parameter
Type
Description

selector

string

A string containing a selector expression to match elements against

Returns:

Type
Description

Selection

import {parseHTML} from "k6/html";
import http from "k6/http";

export default function() {
  const res = http.get("https://loadimpact.com");
  const doc = parseHTML(res.body);

  const titleDoc = doc.find('head title');
  const title = titleDoc.text();
};

Selection.find(selector)


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.