Skip to main content

search

codebolt.browser.search(elementid: string, query: string): Promise<SearchResponse>
Performs a search on the current page using a specified query.

Parameters

NameTypeDescription
elementidstringThe ID of the search input element.
querystringThe search query.

Example

// Navigate to a page with a search feature
await codebolt.browser.goToPage("https://example.com");
await new Promise(resolve => setTimeout(resolve, 2000));

// Perform a search using the search input element
const searchResult = await codebolt.browser.search("search-input", "test query");
console.log('✅ Search performed:', searchResult);

// Example with different search queries
await codebolt.browser.search("searchBox", "codebolt browser automation");
await codebolt.browser.search("q", "JavaScript tutorials");