await driver.wait(until.elementLocated(By.className('searchServiceBtn')), 10000); const searchButton = await driver.findElement(By.className('searchServiceBtn'));
// Wait for the button to be clickable
await driver.wait(until.elementIsVisible(searchButton), 10000);
await driver.wait(until.elementIsClickable(searchButton), 10000);
// Click the search button
await searchButton.click();
console.log('Search button clicked.');
// Wait for the search section to be located
await driver.wait(until.elementLocated(By.id('servicelistSearch-form-wrp')), 10000);
// Check if the search section is displayed
const isDisplayed = await driver.findElement(By.id('servicelistSearch-form-wrp')).isDisplayed();
console.log(`Search section is ${isDisplayed ? 'open' : 'closed'}`);
} catch (error) {
console.error('Error occurred:', error);
I am not able to automate the things with this code