There are a few discrepancies between documented and actual behavior for some of locator formats. Two that I've run into while writing tests include:
The documentation lists class as a valid locator type, but the implementation does not actually account for it; attempting to use it will cause errors.
A locator instantiated with a type of id will throw an error when toXPath() is called, as only the css and xpath types are checked for.
It may be more tenable leverage polymorphism for this implementation, as in replace the type field of the Locator class with subclasses e.g. CSSLocator, XPathLocator, etc.
@DavertMik let me know if you're amenable to this and I'll start working on it.
There are a few discrepancies between documented and actual behavior for some of locator formats. Two that I've run into while writing tests include:
class
as a valid locator type, but the implementation does not actually account for it; attempting to use it will cause errors.id
will throw an error whentoXPath()
is called, as only thecss
andxpath
types are checked for.It may be more tenable leverage polymorphism for this implementation, as in replace the
type
field of theLocator
class with subclasses e.g.CSSLocator
,XPathLocator
, etc. @DavertMik let me know if you're amenable to this and I'll start working on it.