Closed ghost closed 10 months ago
This is because you are trying to pass JSHandle to an object from one context into another. This is unsupported and we'll fix the code to throw a proper error message. To overcome that, you need to create DataTransfer
object in the same iframe where the event target element is. Something like this should work:
const dataTransfer = await this.page.frame({name: 'mk_main'}).evaluateHandle(
// same code as before
);
@yury-s Thank you. can't believe I didn't spot I wasn't using the frame!
All working now :)
Getting a frame.locator.DispatchEvent timeout error when I believe this should work. The button I am attempting to drop on is inside an iframe. I have tried the exact same code on a button on the page (outside the iframe) and it works just fine. I have attached a zip that can reproduce the error.
Originally raised here but was closed but I have updated the attached zip example which should now work OK to be triaged.
System info
Source code
Config file
Test file
Page object file
Steps
Expected Drop event should work/fire and my code should continue to work thereafter.
Actual Get a timeout waiting on the locator.DispatchEvent:
Reproducable Example
reproducable-example.zip
Extract the contents:
npm install
npx playwright test