Playwright Beginner Tutorial 6 | How to use Trace Viewer

preview_player
Показать описание
00:00 *Intro*
01:05 *What is Trace Viewer*
Trace Viewer is a GUI tool that helps viewing the executed test along with snapshots, timeline and other details (traces)

03:14 *How to use Trace Viewer*
Step 1 - Open config file and set trace: 'on-first-retry'
It means - Collect trace when retrying the failed test for the 1st time only
Step 2 - Save and Run a test to fail

14:28 *Screenshot moment*

14:34 *Trace Viewer Options*
'on-first-retry' - Record a trace only when retrying a test for the first time.
'off' - Do not record a trace.
'on' - Record a trace for each test. (not recommended as it's performance heavy)
'retain-on-failure' - Record a trace for each test, but remove it from successful test runs

To set trace on from command *npx playwright test --trace on*

15:32 *Screenshot moment*

15:56 *Different ways to view trace*
Using HTML Report

17:12 *How to set Tracing programmatically*

// test code
});

let context
let page
})

})

38:24 *Outro*

#playwright #automation #testing

▬▬ CI CD DEVOPS ▬▬

▬▬ UI TESTING ▬▬

▬▬ API TESTING ▬▬

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

Every LIKE & SUBSCRIPTION gives me great motivation to keep working for you

You can support my mission for education by sharing this knowledge and helping as many people as you can

If my work has helped you, consider helping any animal near you, in any way you can

NEVER STOP LEARNING
Raghav Pal
Комментарии
Автор

1:40 screen shot of *trace viewer*
3:15 how to use *Trace Viewer*

ruixue
Автор

You are one of the best tutor i have come across in life. Thanks man

nwankwoernestonyebuchi
Автор

Hello Raghav, I am a beginner in Playwright and found these videos immensely helpful. I like your way of teaching from scratch, easy to comprehend and gives new learners the confidence to kickstart with Playwright. I was wondering if you plan to organise for formal Playwright training sessions this year ? so that some interested learners like me can be benefitted from some more common use cases automation using Playwright tool . Of course, we have the dev tutorials from Playwright documentation but the way you have been teaching, simplifies the usage and understanding of the tool, specially for beginners like me

debaratidas
Автор

I am an absolut beginner,
very proud to have followed until here and very curious
for the upcoming sessions. Thank you for these great instructions!

technical.writer
Автор

Another wonderful video! Appreciate your wonderful work :)

mukmusicdiary
Автор

Hi Raghav, The video was very helpful in learning playwright. In my config file, the time out parameter is not exists, so that i could not modify the time out settings for the trace viewer.please guide.

mnvtdns
Автор

I am newbie to Playwright and found your video quite helpful as a starter.I thing i observed, in the trace viewer steps, i can see some additional steps like Before Hooks(fixure: page>browserContext.newPage at the beginning and After Hooks step at the end of the test steps.I can't find any such steps in the spec, js file i am targeting for execution. Does Playwright trace viewer generate those steps internally by default orIs it by default a settings for trace viewer?In which file those Hooks steps are written?Thanks

NiharRoy-pm
Автор

Hi Raghav,
I am also a beginner - Playwright with javascript, your tutorial is helping me a lot to understand the plyawright.
Qus : if i am not adding '.spec' in my .js file name the command to run the test ie 'npx playwright test' is not picking the .js file, can you plz tell why this keyword is require in .js file naming convension?

ArunYadav
Автор

Thank you for the sessions, Happy Teachers Day sir

swathis
Автор

Why would a user want to programmatically specify tracing in the test .js file itself, rather than just setting it up via the playwright.config.js or via the command line `npx playwright test --trace on`?

ArnoDunstatter-polv
Автор

thanks for all your help from your videos. I was able to automate multiple websites from your tutorials. I am kind of stuck though on a few websites. I see the Traceveiwer allows us to get more in depth on what error is occuring but what do I do if the code i am using i got from the playwright codegen? Now the file runs brings up the browser and enter a few text boxes but stops before completing page. Terminal is reading it came as a error for lets say the password text box. How do i go about fixing this if the code came directly from the codegen

christophermoffit
Автор

Hi sir, your videos are so good to learn. these videos are so helping to me. pls help me by doing video on Data parameterization through CSV, Xlsx files

sivaiahb
Автор

Hi @RahgavPal. Can we get a detailed report (OS, Browser, Time etc.) when we run one or more tests successfully in Playwright? Thanks in advanced.

alpozturk
Автор

My trace report that I put for a specific test by adding at the beginning: await screenshots: true, snapshots: true });
and at the end of my test: const tracePath = await is giving me a strange file that is not a zip file and cannot be opened by trace viewer.

Do you know how can I fix that?

MrCRO
Автор

Hello sir, please explain us trace viewer ..in eclipse pom model..
And can we capture both video and snapshots in eclipse pom model...pls share ...

svksuman
Автор

I am an beginner, in testing
how i can fix this error
PS D:\playwright_automaed_ extention_vs-code> npx playwright test .\test\record1_demo.spec.js --headed --prError: No tests found







To open last HTML report run:

npx playwright show-report

ycwijtl
Автор

Hi @Raghav Sir
not able to trace website like amazon for testing purpose
can u tell me why is it so

NikitaFondekar-rzmb
Автор

Hi Raghav, thank you for the video, I'm getting this error:

"SyntaxError: await is only valid in async functions and the top level bodies of modules
Error: No tests found.
Make sure that arguments are regular expressions matching test files.
You may need to escape symbols like "$" or "*" and quote the arguments."

I'm new to Type script, could you please help with this, thank you.

uvplays
Автор

Hi Raghav, good day. I'm trying to create the trace file using context.tracing in my test file but never is created. I have the same values in the playwright.config.ts with "retries: 1, ". Do you know what can be happening?

cnjbravo
Автор

Hi Raghav! I have a record created with default settings. When running it, it passes when using project chromium and webkit but it failes with firefox. In order to avoid this should i make separately a record with firefox ?

cosminmatic