Loading…
Loading…
This is the actual rendered markup of a Practice Hub product card:
1<article class="product-card" data-testid="product-card">
2 <h3>Standing Desk Converter</h3>
3 <p class="sku">SKU-1042</p>
4 <div class="product-meta">
5 <shadow-price value="129.99"></shadow-price>
6 <span>14 in stock</span>
7 </div>
8 <button class="btn btn-primary css-1x9fj2">Add to cart</button>
9</article>A colleague has proposed five locators for the "Add to cart" button of a specific product:
1A. //div[@id='root']/div/main/section[2]/article[3]/button
2B. .css-1x9fj2
3C. //button[text()='Add to cart']
4D. page.getByTestId('product-card').nth(2).getByRole('button', { name: 'Add to cart' })
5E. page.getByRole('article').filter({ hasText: 'Standing Desk Converter' }).getByRole('button', { name: 'Add to cart' })Your task: rank them, and justify the ranking by naming the specific change that breaks each one. Then state which you would use and what you would ask the developer for.
Write your own answer first — the defect report, the case table, the locator, whatever the question asks for. An interviewer grades your reasoning, not your recall.
Practice this live with an AI interviewer
Starts a QA mock interview pre-filled with this problem — you can edit the brief before starting.