پرش به محتوای اصلی

دریافت نقش محاسبه شده

دریافت برچسب WAI-ARIA محاسبه شده یک عنصر.

استفاده
$(selector).getComputedRole()
مثال
getComputedRole.js
it('should demonstrate the getComputedRole command', async () => {
await browser.url('https://www.google.com/ncr')
const elem = await $('*[name="q"]');
console.log(await elem.getComputedRole()); // outputs: "combobox"
})
مقادیر بازگشتی
  • <String> return: برچسب WAI-ARIA محاسبه شده

Welcome! How can I help?

WebdriverIO AI Copilot