Skip to content

waitForResultCount() is not defined error in Karate 2.0.0 #2760

@GuanZitong

Description

@GuanZitong

Summary

The UI testing docs mention waitForResultCount() as a built-in DSL helper, but there is an error waitForResultCount() is not defined error in Karate 2.0.0.

Investigation

It looks like the driver API contains waitForResultCount(), but it is not exposed to the DSL.

Method in Driver.java

/**
* Wait for a specific number of elements to match.
*/
List<Element> waitForResultCount(String locator, int count);
/**
* Wait for a specific number of elements to match with custom timeout.
*/
List<Element> waitForResultCount(String locator, int count, Duration timeout);

There is not WAIT_FOR_RESULT_COUNT in wait methods to be bound in DriverApi.java

// Wait methods
public static final String WAIT_FOR = "waitFor";
public static final String WAIT_FOR_TEXT = "waitForText";
public static final String WAIT_FOR_ENABLED = "waitForEnabled";
public static final String WAIT_FOR_URL = "waitForUrl";
public static final String WAIT_UNTIL = "waitUntil";

Reference

https://docs.karatelabs.io/extensions/ui-testing#waitforresultcount

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions