Object identification is very important part of automation. So one should first learn how to identify the objects. Object Identifiers or Locators are used to uniquely identify the objects used in the Application under Test while creating the test cases. Objects being identified accurately demands certain steps to be followed and is one of the most time consuming and error prone topic of automation. Xframium supports a fully integrated object identification console as well as intelligent location algorithms used to identify the object in an accurate and repeatable way. Below is a listing of all xFramium supported descriptor types and how to use them
The complex locator allows for the grouping of various element locators into a single element. xFramium will filter the complex list by operating system, application context, application version, cloud provider and various other pieces of criteria. Once filtered xFramium will begin to analyze each remaining locator individually until the first object is returned as successful. Each individual locator can be of any type allowing for a powerful mix of locators ensuring a found object and allowing locators with slower performance to only be analyzed if the faster performing locator fails to find the object. This allows for the best mix of accuracy and performance and allows the test case to grow with the inevitable changes in application elements
xFramium Natural Language (XNL) support takes the concept of Natural Language test definition to the object identification layer. XNL allows for elements to be explained in a plain English language that is cross platform and cross application.
XNL languages structure is as follows
position
type
query
optional with
optional
Describes the index of the element such as FIRST, SECOND, LAST, ONLY, etc. Positions of the elements are indexed left to right and top to bottom
Possible values include FIRST
, SECOND
, THIRD
, FOURTH
, FIFTH
, SIXTH
,
SEVENTH
, EIGHTH
, NINTH
, TENTH
, LAST
, ONLY
Describes the type of element to look for
Possible values include TEXTBOX
, CHECKBOX
, BUTTON
, OPTION
, DROPDOWN
,
LABEL
, PASSWORD
, ELEMENT
, SWITCH
Adds some query information to the lookup such as LABELED or NAMED along with the criteria value in single quotes such as NAMED 'Allen'
. It is important to note that filters are applied BEFORE indexing has occurred so you need to apply your position accordingly
NAMED
will use several attribute such as name, id etc to filter the object list before indexing
LABELED
will search for a label and use the element that it describes
Adds some general attributes based queries to the lookup. This allows you to specify attribute values using attributeName=value
based name value pairs. The entire with clause must be in single quotes such as with 'class=css'
UFT emulator used the UFT style of element lookups to define your elements
XPath is an XML based query language used to parse the GUI document and selecting XML/HTML elements. Take a look here for some additional information regarding XPath
Locates and element by its name attribute
Locates and element by its ID attribute
Locates an <A> element by matching the text it displays exactly
Locates an <A> element by verifying that it contains the text it displays
Locates and element by its tag name
Locates elements based on the value of the class attribute. If an element has many classes then this will match against each of them. For example if the value is 'one two onone', then the following classNames will match: 'one' and 'two'
Finds elements via the driver's underlying W3 Selector engine. If the browser does not implement the Selector API, a best effort is made to emulate the API. In this case, we strive for at least CSS2 support, but offer no guarantees. Take a look here for more information regarding CSS Selectors