Executing a click via webdriver has sometime unexpected behaviors.If its not working then alternate way JavascriptExecutor
class to do this.
Its always preferable to use click()
method of the WebElement
.
WebElement element = driver.findElement(By.cssSelector(".btn.btn-main.dropdown-toggle"));
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("arguments[0].click();", element);