Skip to main content
Added some of OP's comments to the main question to consolidate the information. Also added a tag and amended the title slightly.
Source Link

Button won't click even though iI can see itsit's taking me to the save button when doing automation

My code which takes me to the button and highlights it. (I'm running java scripts within Eclipse)

driver.findElement(By.xpath("//button[contains(text(),'Save')]")).click();

My HTML code

<button data-v-7405e096="" type="button" class="pull-right btn btn-primary">Save</button>

The error

Exception in thread "main" org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression //button[contains(text(),'Save'‌​)] because of the following error: SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//button[contains(text(),'Save'‌​)]' is not a valid XPath expression

Button won't click even though i can see its taking me to the save button when doing automation

My code which takes me to the button and highlights it.

driver.findElement(By.xpath("//button[contains(text(),'Save')]")).click();

My HTML code

<button data-v-7405e096="" type="button" class="pull-right btn btn-primary">Save</button>

Button won't click even though I can see it's taking me to the button when doing automation

My code which takes me to the button and highlights it (I'm running java scripts within Eclipse)

driver.findElement(By.xpath("//button[contains(text(),'Save')]")).click();

My HTML code

<button data-v-7405e096="" type="button" class="pull-right btn btn-primary">Save</button>

The error

Exception in thread "main" org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression //button[contains(text(),'Save'‌​)] because of the following error: SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//button[contains(text(),'Save'‌​)]' is not a valid XPath expression

button wont Button won't click even though i can see its taking me to the save button when doing automation

My code which takes me to the button and highlights it. driver.findElement (By.xpath("//button[contains(text(),'Save')]")).click();

driver.findElement(By.xpath("//button[contains(text(),'Save')]")).click();

My HTML code Save

<button data-v-7405e096="" type="button" class="pull-right btn btn-primary">Save</button>

button wont click even though i can see its taking me to the save button when doing automation

My code which takes me to the button and highlights it. driver.findElement (By.xpath("//button[contains(text(),'Save')]")).click();

My HTML code Save

Button won't click even though i can see its taking me to the save button when doing automation

My code which takes me to the button and highlights it.

driver.findElement(By.xpath("//button[contains(text(),'Save')]")).click();

My HTML code

<button data-v-7405e096="" type="button" class="pull-right btn btn-primary">Save</button>
Source Link

button wont click even though i can see its taking me to the save button when doing automation

My code which takes me to the button and highlights it. driver.findElement (By.xpath("//button[contains(text(),'Save')]")).click();

My HTML code Save