I am using Playwright trying to automate a button clicking action. I have tried to locate the HTML content through several methods, but will not click and proceed to the next screen.
Here is the HTML content:
[<button class="c-button checkoutConfirmButton--OXR5TyUP f-primary f-flex" data-bi-dnt="true" data-tv-strategy-up="projection" data-focus-rank="0">Checkout</button>]
My Methods: page.get_by_role("button", name="Checkout").click() page.get_by_text("Checkout", exact=True).click()
I expect the page to move to the next screen but the code refuses to interact. I've also added many print statements for errors and found out the button is not being located. Am I messing up my "locators" or should I use something else? Note: This is the only content with "Checkout" on the page.
source https://stackoverflow.com/questions/77470118/playwright-locator-issue
Comments
Post a Comment