search
codebolt.browser.search(elementid: string, query: string): Promise<SearchResponse>
Performs a search on the current page using a specified query.
Parameters
Name | Type | Description |
---|---|---|
elementid | string | The ID of the search input element. |
query | string | The 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");