<a id="compareCompanies" b:onclick="needsController.showQuotes = true;" href="#">Compare companies</a>
Below is the Selenium Webdriver JavaScript code using Mocha:
driver.wait(function () {
driver.findElement(webdriver.By.id("compareCompanies"));
}, 5000);
var compareCompaniesLink = driver.findElement(webdriver.By.id("compareCompanies"));
compareCompaniesLink.click();
The error message I encountered reads as follows:
NoSuchElementError: Unable to locate element: {"method":"CSS selector","selector":"*[id=\"compareCompanies\"]"}