Used xpath successfully in the past with the Android Webdriver client
but now it appears it no longer works. This was actually using a
select which seems to use xpath:
Select select = new Select(driver.findElement(By.id(navSelect)));
select.selectByVisibleText(name);
Seeing this kind of thing in the logs:
org.openqa.selenium.WebDriverException: Error: {"message":"Unable to
locate elements with the xpath expression .\/\/option[normalize-
space(.) = \"My Link\"] because of the following error:\nTypeError:
Result of expression 'd.evaluate' [undefined] is not a function."}
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info:
os.name: 'Linux', os.arch: 'armv5tejl', os.version:
'2.6.29-00261-g0097074-dirty', java.version: '0'
Driver info: driver.version: AndroidWebDriver; duration or timeout:
691 milliseconds
Build info: version: '2.13.0', revision: '14793', time: '2011-11-18
13:16:47'
System info:
os.name: 'Mac OS X', os.arch: 'x86_64', os.version:
'10.6.8', java.version: '1.6.0_31'
Driver info: driver.version: RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:
27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at
org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:
147)
at
org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:
113)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:
416)
at
org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:
231)
at
org.openqa.selenium.remote.RemoteWebElement.findElements(RemoteWebElement.java:
161)
at
org.openqa.selenium.remote.RemoteWebElement.findElementsByXPath(RemoteWebElement.java:
211)
at
org.openqa.selenium.By$ByXPath.findElements(By.java:333)
at
org.openqa.selenium.remote.RemoteWebElement.findElements(RemoteWebElement.java:
146)
at
org.openqa.selenium.support.ui.Select.selectByVisibleText(Select.java:
113)