I am tring to find a button in a webpage using find elements, the page can contain one of the below button ID's.
driver.findElements(By.xpath("//*[contains(@id,'topBtn')]"))
driver.findElements(By.xpath("//*[contains(@id,'WSMplasticTop')]"))
driver.findElements(By.xpath("//*[contains(@id,'bottomApplyBtn')]"))
The above code is working as expected when i use the Firefox Driver, where as getting the below error when i run in Chrome Driver.
org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression //*[contains(@id='bottomApplyBtn')] because of the following error:
SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//*[contains(@id='bottomApplyBtn')]' is not a valid XPath expression.
Just wanted to know whether i have done any mistake