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

custom$$

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

使用法
$(selector).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('myStrat', (selector) => {
return document.querySelectorAll(selector)
})

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

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

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

WebdriverIO AI Copilot