I have some HTML code:
<div>
<div id="order-1"></div>
<div id="order-2"></div>
</div>
I want to find all DIVs with IDs 'order'. In Ruby I try
divs = driver.find_elements :xpath, '//div[matches(@id, "order-[0-9]")]'
But Selenium gives a error
Selenium::WebDriver::Error::InvalidSelectorError: invalid selector: Unable to locate an element with the xpath expression //div[matches(@id, "order-[0-9]")] because of the following error: SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//div[matches(@id, "order-[0-9]")]' is not a valid XPath expression.
Why?