Forum Discussion
Hi,
Documentation for .FindElement() does not mention possibility to use regular expressions, so I am far not sure that it will work. Another consideration to support this thought is that .FindElement() was introduced with cross-platform web testing and seems to transfer all calls to Appium under the hood. Thus, as Appium does not support regexp for XPath/CSS selectors, likewise .FindElement() does not.
> when using the Find methods, only xpath 1.0 is supported
Correct. This is documented in the article for FindElement.
> when the FindElement method is successful, does it automatically click on the object?
No. Just a found element is returned and it is up to your test code to do what is required with the found element (click it, drag it, use it as an anchor for the next search, etc.).
Hey Alex,
So my understanding is that using regexp is not much of an option when specifying selector values. I guess it is a drawback of using xpaths or css selectors instead of the good-old object properties. I had a similar issue with a Logout link, which I would think is easy to identify but it wasn't the case. There is a dependency on the parent object page. I was trying to find a way how to make it "page-independent", but I couldn't as the object relies on xpath.
Thanks for your note and for looking into it. I ended up using SendKeys and it works ok. Will see if there are other options in the future.
Regards,