Reputation: 81
I am trying to find the input element with value "Save and Return."
I have tried to find it with xpath to the value text like so:
driver.findElement(By.xpath("//input[contains(@value,'Save and Return']")).click();
Upvotes: 3
Views: 403
Reputation: 84
You need
driver.findElement(By.cssSelector("input[value=\\"Save and Return\\"]"));
Tell me if it doesn't work. Give more details about the errors. I might have mistaken about the escape characters \\ in the string.
Upvotes: 3