It provides utility methods for the findElement
and findElements
.
Both Driver and Element include this mixin
- Source:
Methods
(async) findElementCss(value)
Find first element matching CSS
Parameters:
Name | Type | Description |
---|---|---|
value |
string |
The CSS expression |
- Source:
(async) findElementLinkText(value)
Find first element matching text
Parameters:
Name | Type | Description |
---|---|---|
value |
string |
The text to match |
- Source:
Example
var a = driver.findElementLinkText('cick here')
// or...
var el = driver.findElementCss('#something') // or
var l = item.findElementLinkText('click here')
(async) findElementPartialLinkText(value)
Find first element matching link text
Parameters:
Name | Type | Description |
---|---|---|
value |
string |
The link text to match |
- Source:
Example
var a = driver.findElementPartialLinkText('cick here')
// or...
var el = driver.findElementCss('#something') // or
var l = item.findElementPartialLinkText('click here')
(async) findElementTagName(value)
Find first element matching tag name
Parameters:
Name | Type | Description |
---|---|---|
value |
string |
The tag name to match |
- Source:
Example
var item = driver.findElementTagName('item') // or
var subItem = item.findElementTagName('subitem')
(async) findElementXpath(value)
Find first element matching xpath
Parameters:
Name | Type | Description |
---|---|---|
value |
string |
The xpath to match |
- Source:
Example
var item = driver.findElementXpath('/html/body/form[1]') // or
var subItem = item.findElementXpath('/div/div/subitem')
(async) findElementsCss(value)
Find all elements matching CSS
Parameters:
Name | Type | Description |
---|---|---|
value |
string |
The CSS expression |
- Source:
Example
var allItems = driver.findElementsCss('.list')
var item = allItems[0]
var allTitles = item.findElementsCss('.title')
(async) findElementsLinkText(value)
Find all elements matching text
Parameters:
Name | Type | Description |
---|---|---|
value |
string |
The text to match |
- Source:
Example
var links = driver.findElementsLinkText('cick here')
// or...
var el = driver.findElementCss('#something') // or
var links = item.findElementsLinkText('click here')
(async) findElementsPartialLinkText(value)
Find all elements matching link text
Parameters:
Name | Type | Description |
---|---|---|
value |
string |
The link text to match |
- Source:
Example
var links = driver.findElementsPartialLinkText('cick here')
// or...
var el = driver.findElementCss('#something') // or
var links = item.findElementsPartialLinkText('click here')
(async) findElementsTagName(value)
Find all elements matching tag name
Parameters:
Name | Type | Description |
---|---|---|
value |
string |
The tag name to match |
- Source:
Example
var items = driver.findElementsTagName('item') // or
var el = items[0]
var subItem = el.findElementsTagName('subitem')
(async) findElementsXpath(value)
Find all elements matching xpath
Parameters:
Name | Type | Description |
---|---|---|
value |
string |
The xpath to match |
- Source: