Skip to main content

Find By AI Method

DevTools adds additional methods to allow you to only use element names to find elements. This will return the cypress element that represents the visual one.

Below is the same test case as the basic example where we will search for hello world on DuckDuckGo.com.

tip

You can write your entire test, and then execute it with interactive mode to quickly write larger tests.

describe("Search DuckDuckGo", () => {
it("Login", () => {
cy.visit("https://www.duckduckgo.com");
cy.findByAI('searchBox').type("hello world");
});
});