انتقل إلى المحتوى الرئيسي

custom$$

يسمح لك customs$$ باستخدام إستراتيجية مخصصة تم إعلانها باستخدام browser.addLocatorStrategy. اقرأ المزيد عن استراتيجيات المحدد المخصصة في وثائق المحدد.

الاستخدام
$(selector).custom$$(strategyName, strategyArguments)
المعلمات
الاسمالنوعالتفاصيل
strategyNamestring
strategyArguments*
مثال
example.js
it('should get all the plugin wrapper buttons', async () => {
await browser.url('https://webdriver.io')
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.ElementArray>

Welcome! How can I help?

WebdriverIO AI Copilot