The following inspect code i have is to click the button I can confirm my order
<button type="submit" class="button btn btn-default button-medium">
<span>I confirm my order<i class="icon-chevron-right right"></i></span>
</button>
<span>I confirm my order<i class="icon-chevron-right right"></i></span>
The one I've tried:
driver.findElement(By.xpath("//button[contains(text(),'I confirm my order')]\"")).click();
The error is coming out using Eclipse as IDE for Selenium Testing stated below:
org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression //button[contains(text(),'I confirm my order')]" because of the following error:
SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//button[contains(text(),'I confirm my order')]"' is not a valid XPath expression.