0

How can I get the content of iframe which has a document inside using playwright script?

At the moment I am using framelocator

 const iframe = page.frameLocator('#CustomPartyNavAnchor15');
 const contentFrame = await iframe.locator('#is-responsible-value').textContent();

 console.log( 'Value: ', contentFrame);

I've tried to validate the following

playwright.js code

This one is giving actual response as 'Undefined'. And, I think it is due to non-serializable issue for HTML dt/dd selector.

I can select the item, but I cannot verify the value. I have tried .toHaveValue / .toHaveText / .toBe assertions as well. None is working.

Does anyone know how to validate the value for Html dt/dd item with Playwright.js?

I have tried validating with inner.text toHaveValue / toHaveText / toHaveAttribute / toEqual / toBe

  • Please share a [mcve] with the site itself (or a minimal reproduction of it) and the code. Thanks. – ggorlen Feb 17 '23 at 16:05

0 Answers0