![]() Marcels uses JavaScript to find the element, and AfroMoglis uses pure C and the CodedUI API. It leads to a lot of new bad practices replacing old bad practices among people who don't really know any better either way. Windows 7 Internet Explorer 11 Web site delivered from localhost and is marked 'trusted' in the Internet Options Security Settings Update: Thanks to both marcel de vries and AfroMogli for their answers. I think we're in violent agreement, I just disagree with the way it's stated sometimes. Not just blind blanket policies like "don't use XPath, XPath is bad and slow and morally wrong." The upswing here is that people using either CSS selectors or XPaths should know how to make or refine XPaths well and when to use one or the other. Just because we have things like C# and Java and Python and everything else, doesn't mean C is "deprecated" - in fact quite the opposite, as the most-used native interpreters and compilers for all those languages are ultimately written in C. Why is that? Because it's more universal and also more capable (Xpath can do everything CSS-sel can do CSS cannot say the same for XPath). "Deprecated" generally implies "you should stop using this because there's better alternatives and it will be going away at some point" which is just not the case.Īs you point out, in some manifestations of Selenium (such as RC), the fallback option is XPath. Sometimes even when you are interacting with an in-house application. (You can't always just get test hooks added to the AUT, either. If you like writing needless iteration that is. I mean, try looking up a column value in a row of an HTML table based on a value in a key column using CSS selectors, that should be fun. Yeah I agree with that, but the whole "xpath is deprecated" just isn't a thing and it's misleading, as is "ID is preferred." As bite size blanket statements without qualifiers or context, they only lead to more bad practices when they are mainly targeted at people already doing bad practices.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |