メインコンテンツにスキップ

custom$$

custom$$を使用すると、browser.addLocatorStrategyを使用して宣言されたカスタム戦略を使用できます。カスタムセレクタ戦略の詳細については、セレクタのドキュメントを参照してください。

使い方
browser.custom$$(strategyName, strategyArguments)
パラメータ
名前詳細
strategyName文字列
strategyArgumentsparam
example.js
it('should get all the plugin wrapper buttons', async () => {
await browser.url('https://webdriverio.dokyumento.jp')
await browser.addLocatorStrategy('myStrategy', (selector) => {
return document.querySelectorAll(selector)
})

const pluginWrapper = await browser.custom$$('myStrategy', '.pluginWrapper')

console.log(await pluginWrapper.length) // 4
})

ようこそ!何かお手伝いできることはありますか?

WebdriverIO AI Copilot