Skip to content

Locator files

james-goddard-magentys edited this page Jul 25, 2017 · 9 revisions

Locator yaml files store the location of the web page elements to be used within your tests. Locator yaml files are stored within your /conf folder.

The following object identifiers or locators are supported id, name, css, path, and should be used in that order of precedence whenever possible

Examples:

id:

with the html:

<h1 id="myHeader">Hello World!</h1>  

locator file entry:

  id: 
    home-page.my-header: 'myHeader'

name:

with the html:

<a name="header">Hello World!</a>

locator file entry:

  name: 
    home-page.my-header: 'header'

css:

with the html:

<div class="header"></div>

locator file entry:

  css:
    home-page.my-header: '.header'

xpath:

with the html:

     <body>
       <div class="header"></div>
     </body>

locator file entry:

     xpath:
       home-page.my-header: '/html/body/div[1]'