-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: JSONL codegen doesn't include framepath #34157
Comments
Hi Alex! I'll discuss this with the team. From a technical perspective, we could add a frame path to the JSON, but i'm unsure about the state of JSONL. You're one of the first people to report using it. Could you elaborate on your usecase? Why is it useful for you to transform JSONL to Python, instead of using the Playwright-generated Python in the first place? |
Hi Simon, for context I work at Internet Archive where we're using Playwright for some web preservation projects. I'm trying to create a fast and secure workflow where a web archivist can record behaviors with Playwright codegen and the inspector. These behaviors would go into a database to assist current and future web crawls, and could potentially serve as tests that our replay of archived web pages continue to work in the future. I'm interested in Since we do have diverse languages and technologies in play, and we're trying to build a library to stand the test of time, it's also appealing to me to store these behaviors and tests in a language agnostic format. This codegen workflow is experimental, but if it works it could help us bring many more librarians and archivists into high fidelity web preservation work. Thanks again for your work, Playwright and the codegen+inspector tools are inspiring! |
I also needed the framepath on my playwright fork so that recorded scripts could be replayed. I ended up patching it and adding a Meanwhile, and because I'm adding a new feature to allow editing the generated code directly in codegen chrome extension, I moved on to a different approach and rolled back that change, but nevertheless, |
Version
1.49.1
Steps to reproduce
NodeJS:
await page.locator('iframe').contentFrame().getByRole('heading', { name: 'Frame' }).click();
JSONL:
Expected behavior
I expected to see some indication of the framepath in the JSONL. Since it's missing, the JSONL of the recorded action is ambiguous.
Actual behavior
NodeJS:
await page.locator('iframe').contentFrame().getByRole('heading', { name: 'Frame' }).click();
JSONL:
Additional context
I was hoping to use JSONL output of codegen as a safe serialization format for basic Playwright interactions. I was working on writing a program that takes the JSONL and turns it into Python. That seems like it could still work for many cases, but looking at the code in playwright-core/src/server/codegen/jsonl.ts I see it's much simpler than the other LanguageGenerator instances, and maybe there are other edge cases out there.
Still, this JSONL feature is pretty awesome (as is Playwright, thank you for all that you do). I think I can make a workaround elsewhere in my own workflow.
Environment
The text was updated successfully, but these errors were encountered: