#6 - How To Maximize Browser Window In playwright | Viewport In Playwright

  Рет қаралды 14,007

Mukesh otwani

Mukesh otwani

Күн бұрын

Пікірлер: 31
@Bhushantbn
@Bhushantbn Жыл бұрын
🎯 Key Takeaways for quick navigation: 00:18 🌐 *Playwright lacks a direct method to maximize the screen, but the "viewport" feature provides a solution to set and get the width and height of the browser page.* 02:11 📏 *Use the "viewport" feature to dynamically change screen size based on testing requirements. Capture and print width and height, adjusting them as needed.* 04:27 ⚙️ *Set viewport size globally in `playwright.config.js` for the entire project. For test-specific changes, use `test.use` in the test file, allowing flexibility in adapting viewport settings.* Made with HARPA AI
@MikeL-q1e
@MikeL-q1e 3 ай бұрын
Perfect. This video is just what i was looking for. Simple and to the point.
@Mukeshotwani
@Mukeshotwani 3 ай бұрын
Thanks mate 😀
@ghummakad_premi
@ghummakad_premi Жыл бұрын
There is another method that Playwright gives which is passing the chrome options like --start-maximized or --start-fullscreen . If this method doesn't work for you, try passing these in the config file.
@Mukeshotwani
@Mukeshotwani Жыл бұрын
Thanks Rahul
@AutomationeLearn
@AutomationeLearn 10 ай бұрын
@Satyam_Gupta_1920 you have to use like this. comment device and viewport and add viewport: null use: { launchOptions: { args: ["--start-maximized"], }, } projects: [ { name: 'chromium', use: { //...devices['Desktop Chrome'], //viewport: { width: 1720, height: 850 }, viewport: null, }, }]
@salmaakhter6359
@salmaakhter6359 Жыл бұрын
Very helpful. Thank you Mukesh.
@ProfessorSauvaje
@ProfessorSauvaje Жыл бұрын
good job
@Mukeshotwani
@Mukeshotwani Жыл бұрын
Thanks
@jiras.3592
@jiras.3592 Жыл бұрын
Is it the best practice to declare the viewport in the same test file? I want to specify the viewport in each test file because I will test on Desktop and Mobile size. But I'm not sure if it is the best way.. 😢
@TausifJaved
@TausifJaved Жыл бұрын
Thanks for the tutorial setViewportSize changes the height and width of the window but not its position do we have something to replicate selenium window maximize in playwright?
@sandeepsan2218
@sandeepsan2218 2 жыл бұрын
Hi Mukesh, I don't know is it a right place to ask this question, Does playwright support for OTT platform application as u know it has all almost audio and video playing. Also can u suggest is there any specific/good tool that support for OTT. Appreciate to the way you presents.
@divyaarora9341
@divyaarora9341 Жыл бұрын
What if I run the code in an extended screen whose view port size is different. It won't work there. This method doesn't look like an ideal solution.
@Mukeshotwani
@Mukeshotwani Жыл бұрын
Hi Divya, development and execution is 2 different part. Eventually your test will be executed on VM or Docker Container during CI-CD, so you need to test according to that as well. Taking about extended screen for development you need to consider at-least one of the screen as primary and change the view port accordingly.
@salikhanan
@salikhanan Жыл бұрын
Hello, I get following any Idea why? Error: Playwright Test did not expect test.use() to be called here. Most common reasons include: - You are calling test.use() in a configuration file. - You are calling test.use() in a file that is imported by the configuration file. - You have two different versions of @playwright/test. This usually happens when one of the dependencies in your package.json depends on @pla
@DrashtiPatel-uc8zq
@DrashtiPatel-uc8zq 5 ай бұрын
I want to run test in headless mode and screen maximized. Is it possible?
@Mukeshotwani
@Mukeshotwani 5 ай бұрын
Yes why not. By default playwright test runs in headless mode when you run from CLI
@karthikeyann2203
@karthikeyann2203 26 күн бұрын
Can you tell How to zoom in and zoom out using playwright
@Mukeshotwani
@Mukeshotwani 23 күн бұрын
Using keyboard Controls
@ostap.koverko
@ostap.koverko 9 ай бұрын
Thanks!
@Mukeshotwani
@Mukeshotwani 8 ай бұрын
Welcome
@ninacdr
@ninacdr 8 ай бұрын
um verdadeiro ANJO
@Mukeshotwani
@Mukeshotwani 7 ай бұрын
Muito obrigado querido
@Pancham200
@Pancham200 4 ай бұрын
How to set browser zoom level to 67% view rather than 100% as per the application need?
@jainam6
@jainam6 2 жыл бұрын
1st view
@hasanrakibul97
@hasanrakibul97 Жыл бұрын
But it doesn't work for windows
@Mukeshotwani
@Mukeshotwani Жыл бұрын
What worked for you?
@sagarsjdjfn
@sagarsjdjfn Жыл бұрын
not working
@alexandre_borissov
@alexandre_borissov 5 ай бұрын
the name of this video is confusing: there's no info on maximizing the window - just on setting viewport size. dislike
@Mukeshotwani
@Mukeshotwani 5 ай бұрын
We don’t have any method for maximize so this is the fix which I provided by setting viewport.
@imperuminate
@imperuminate 2 жыл бұрын
Дякую! keep going )
#7 - How To Take Screenshots | Videos | Trace Files in Playwright
8:48
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 29 МЛН
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
Playwright - How to maximize browser window
3:51
Slava Bulba
Рет қаралды 192
Playwright Working with Multiple tabs (NODEJS)
7:04
CommitQuality
Рет қаралды 6 М.
#1-What is Playwright
11:13
Mukesh otwani
Рет қаралды 26 М.
Reuse Playwright  Code across Files and Tests with Fixtures
5:54
The problems with viewport units
13:23
Kevin Powell
Рет қаралды 368 М.
How to Automate Browser Tasks with JavaScript
8:54
edutechional
Рет қаралды 208 М.
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 29 МЛН