1,072
edits
No edit summary |
|||
| Line 13: | Line 13: | ||
=== Locators in nested classes === | === Locators in nested classes === | ||
The locators are defined as simple string 'constants' in classes. The arrangement is intended to take advantage of autocomplete features in IDEs allowing someone to build a "path" to a locator. The highest level classes are | The locators are defined as simple string 'constants' in classes. The arrangement is intended to take advantage of autocomplete features in IDEs allowing someone to more easily build a "path" to a locator. The highest level classes are pages around a feature such as Personas or Collections. Within them are classes for types of pages, such as landing or browse pages. These classes have locators for elements or nodes, and subclasses for groups of elements which themselves contain locators. | ||
Locators for the n-th item in a list are embedded with "%s" to be used as a formator to create the completed locator, for example: locatorVar % itemIndex.<br> | |||
An | Class names are capitalized. Locator names are all lowercase. An IDE's autocomplete feature generally differentiates between classes and variables with different icons. If an autocomplete feature isn't available or isn't responding the AMOlocators module can be viewed in an editor that collapses classes to more quickly find locators. | ||
#While editing a script after typing "AMOlocators." (or local instance) a list classes appears containing Collections, Personas | An example of using autocomplete in an IDE that's aware of classes: <br> | ||
#After selecting a class and typing '.' another list appears for the classes within it, perhaps LandingPage | |||
#After selecting one of these classes a longer list appears. | #While editing a script after typing "AMOlocators." (or a local instance) a list classes appears containing Categories, Collections, Personas. <br> | ||
#After selecting a class and typing '.' another list appears for the classes within it, perhaps BrowsePage, LandingPage, SearchResults. <br> | |||
#After selecting one of these classes (pages) a longer list appears with variables, defining locators, and classes, defining groups of locators within the page. This is where a locator for the page's header <h2> tag or breadcrumb will appear. It may contain a locator for an entire info box and/or locators for individual elements such as header, description and link. A node with many elements will likely have a class that contains the elements.<br> | |||
<br> | <br> | ||
edits