Difference between revisions of "Lapis Lazuli:Cheatsheet"

From Test Automation Wiki
Jump to: navigation, search
(Created page with "== About this page == This is the Lapis Lazuli Cheat Sheet. Here there will be a list containing the most used examples of Lapis Lazuli. {| class="wikitable" style="font-fam...")
 
Line 15: Line 15:
 
!colspan="4"|Finding functions
 
!colspan="4"|Finding functions
 
|-
 
|-
! [[browser.find()]]
+
! [[Lapis_Lazuli:browser.find()|browser.find()]]
! [[browser.multi_find()]]
+
! [[Lapis_Lazuli:browser.multi_find()|browser.multi_find()]]
! [[browser.find_all()]]
+
! [[Lapis_Lazuli:browser.find_all()|browser.find_all()]]
! [[browser.multi_find_all()]]
+
! [[Lapis_Lazuli:browser.multi_find_all()|browser.multi_find_all()]]
 
|-
 
|-
 
| Search using 1 selector
 
| Search using 1 selector
Line 25: Line 25:
 
| Return all results matching the multiple selectors
 
| Return all results matching the multiple selectors
 
|-
 
|-
!colspan="4"|Finding options
+
!colspan="4"|[[Lapis_Lazuli:Browser.find()#Find_Options|Finding options]]
 
|-
 
|-
 
!"id"
 
!"id"

Revision as of 17:00, 20 June 2016

About this page

This is the Lapis Lazuli Cheat Sheet. Here there will be a list containing the most used examples of Lapis Lazuli.

=== Lapis Lazuli Cheat Sheet ===
Definitions
selector The values to search an element, e.g. a
element with class="blue"
collection Also known as an Array. This is a list of multiple values within 1 variable.
Finding functions
browser.find() browser.multi_find() browser.find_all() browser.multi_find_all()
Search using 1 selector Search using multiple selectors Return all results matching 1 selector Return all results matching the multiple selectors
Finding options
"id"
browser.find("elmId")
:element
browser.find(
  :div => {
    :class => 'elmClass'
  }
)
:like (long)
browser.find(
  :like => {
    :element => :input,
    :attribute => 'name',
    :value => 'surname'
  }
)
:like (short)
browser.find(
  :like => [:input, 'name', 'surname']
)
:pick
browser.find_all(
    :like => [:div, :class, 'foo'],
    :pick => :last
)
:filter_by
browser.find(
  :like => [:input, 'name', 'surname'],
  :filter_by => :present?
)
:context
form = browser.find(:div => {:id => 'login_form'})
inputs = browser.find(
  :input => {:name => 'username'},
  :context => form
)
:message
browser.find(
  :div => {:class => 'error-box'},
  :message => 'The error box was present, so an error occurred!'
)