Skip to content
Julien Gidel edited this page Mar 22, 2021 · 1 revision

What pages are

Pages are the possibility to store every path to UI elements to reuse them in your scenario.

Creation

In your page directory, create a folder named 'wikipedia' and create a new yaml file 'index.yaml'. This yaml file represents a page.

Now you can define your elements :

wikipedia: #This parent node is important
  search-bar:
    id: search
  search-icon:
    id: search-icon
  body:
    css: body

Use

Now that your page is created, you can use it in your scenario. You first need to load the page then use pageElement instead of id or xpath :

browser: chrome
scenario:
  steps:
    - go: http://wikipedia.fr
    - print: This scenario use a page
    - page: wikipedia.index #Load the page
    - fill:
        pageElement: search-bar #Use the element defined in wikipedia/index.yaml file
        with: 'PHP'

If your page isn't loaded, you will not be able to use the element and AutoMate will return an exception.

Clone this wiki locally