dequelabs / axe-core-npm

Mozilla Public License 2.0
577 stars 65 forks source link

How to check the accessibility of an element with nth #1021

Closed jiz17043 closed 5 months ago

jiz17043 commented 5 months ago

Product

playwright

Question

I have an element in the page using locator like this page.locator('div.container').nth(1) I wonder how could I check the accessibility of such element using include

straker commented 5 months ago

Thanks for the question. The include option is a CSS selector, so you'd have to craft a CSS selector that matches the element in question. If the .container elements are not siblings (meaning you wouldn't be able to use nth-child or nth-of-type selectors), you'll probably have to use a more specific selector to grab the one you want.

padmavemulapati commented 4 months ago

@michael-siek , Can you please suggest me any possible test using our test-fixtures