79094826

Date: 2024-10-16 15:48:59
Score: 1
Natty:
Report link

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

Reasons:
  • Blacklisted phrase (1): I am not able to
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: manasa gaddam