I'm having difficulty clicking a button with Selenium.
Here is the DOM structure: http://example.com/dom
I have identified the button element using a valid Xpath that returns one node as shown below:
WebElement send_message_button = driver.findElement(By.xpath("//*[@class='mp-button-content'][.='Send Message']"));
I have attempted to click the button using the Xpath in different ways, but none of them seem to work for me.
Using WebDriver's click()
method : send_message_button.click()
JavaScriptExecutor:
JavascriptExecutor js = (JavascriptExecutor)driver;
js.executeScript("arguments[0].click();", send_message_button);
Actions class:
Actions action = new Actions(driver);
action.moveToElement(send_message_button).click().build().perform();
I have also checked if the button is located inside a frame/iframe, but it does not appear to be the case.