Menu
WebdriverIODocsAPIHelpVersionsContributeGitHub
WebdriverIO
  • Docs
  • API
  • Help
  • Versions
  • Contribute
  • GitHub
  • Introduction
    • API Docs
  • Protocols
    • Webdriver Protocol
    • Appium
    • JSON Wire Protocol
    • Mobile JSON Wire Protocol
    • Chromium
    • Sauce Labs
    • Selenium Standalone
  • Testrunner
    • Expect
  • browser
    • $$
    • $
    • call
    • custom$$
    • custom$
    • debug
    • deleteCookies
    • execute
    • executeAsync
    • getCookies
    • getWindowSize
    • keys
    • newWindow
    • pause
    • react$$
    • react$
    • reloadSession
    • saveRecordingScreen
    • saveScreenshot
    • setCookies
    • setTimeout
    • setWindowSize
    • switchWindow
    • touchAction
    • uploadFile
    • url
    • waitUntil
  • element
    • $$
    • $
    • addValue
    • clearValue
    • click
    • custom$$
    • custom$
    • doubleClick
    • dragAndDrop
    • getAttribute
    • getCSSProperty
    • getHTML
    • getLocation
    • getProperty
    • getSize
    • getTagName
    • getText
    • getValue
    • isClickable
    • isDisplayed
    • isDisplayedInViewport
    • isEnabled
    • isEqual
    • isExisting
    • isFocused
    • isSelected
    • moveTo
    • react$$
    • react$
    • saveScreenshot
    • scrollIntoView
    • selectByAttribute
    • selectByIndex
    • selectByVisibleText
    • setValue
    • shadow$$
    • shadow$
    • touchAction
    • waitForClickable
    • waitForDisplayed
    • waitForEnabled
    • waitForExist
    • waitUntil

custom$

The custom$ allows you to use a custom strategy declared by using browser.addLocatorStrategy

Usage#
browser.custom$(strategyName, strategyArguments)
Parameters#
NameTypeDetails
strategyNameString
strategyArgumentsAny
Example#
it('should fetch the project title', () => {
browser.url('https://webdriver.io')
browser.addLocatorStrategy('myStrat', (selector) => {
return document.querySelectorAll(selector)
})
const projectTitle = browser.custom$('myStrat', '.projectTitle')
console.log(projectTitle.getText()) // WEBDRIVER I/O
})
Edit this page
Previous
« custom$$
Next
debug »

Community

  • Twitter
Copyright © 2020 OpenJS Foundation