Testim Documentation

Welcome to the Testim documentation. You'll find comprehensive guides to help you get started quickly, example code snippets, and tips for being more productive. You will also find details about advanced features that allow you to customize Testim to fit your environment or special testing conditions. Don't worry, we'll support you if you get stuck. Let's jump right in!

Guides    Changelog



This is a TDK feature

This is not supported in Testim's visual editor

This method is used to check if a radio element is checked or not.

  • selector {string | TDKStepLocator} a CSS selector or smart locator.
  • returns: Promise that fulfills with whtehr or not this radio button is checked
// ✅ check that a given radio selected
const isChecked = await radio('input[type=radio]');
expect(isChecked).to.equal(true); // for example with an assertion library

// ✅ same with locator
const isChecked = await radio(l('input[type=radio]'));
expect(isChecked).to.equal(true); // for example with an assertion library

// ❌ need to check the return value and perform an assertion
await checkbox('.signed-up');

Full Example:

'use strict';

const expect = require('chai').expect;
const { go, test, click, radio } = require('testim');

test("radio button", async () => {
    await go'use strict';('http://jsbin.testim.io/zur/');
    await click('#first')
    let firstChecked = await radio('#first');
    let secondChecked = await radio('#second');
    await click('#second')
    firstChecked = await radio('#first');
    secondChecked = await radio('#second');

Updated about a year ago


Suggested Edits are limited on API Reference Pages

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