Access Input field of Stripe Payment using Playwright and C#

I m trying to access the id of the field of card number in stripe so i can input card number using c# and playwright. i have a screenshot of the DOM and I tried the below code but in vain. could you please advise on how to access the card number ID ?

 var CardNumberLocator = Page.Locator("id=Field-numberInput");
 await CardNumberLocator.FillAsync("1234123412341234");

You’re trying… to access… the card number field… of a payment form.

There are so many red flags and sirens going off from this post that I don’t think you’re likely to get a proper answer, but even if we did… what’s Page? What class is it? Are you sure you’re using the function correctly?

Hi this a stripe test page that is publicly available online to anyone so only demo test page. The id is correct just need to locate the frame which is invisible on the page

I repeat the question.

What class is Page?

The reason i say this is because unless Page is a variable you’ve instantiated, you’re calling the class function without context, so your code would return an empty locator from the Locator function.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.