Playwright with TypeScript Series - th-cam.com/play/PL83cimSRP5ZmwhC6u255huRwSi9tlP-nc.html Recording Video - th-cam.com/video/JCpYFqdu2-c/w-d-xo.html Page Fixture Creation Video - th-cam.com/video/hEmTT4FV3-Q/w-d-xo.html POM with Fixtures - th-cam.com/video/qyCPtbEztvw/w-d-xo.html Playwright Shorts Series - th-cam.com/play/PL83cimSRP5ZlgDL11AGCufbTmADTOwHhO.html
@abhishekbhardwaj7764 Thank you so much for the kind words! I'm thrilled you enjoyed the video. Feel free to share it with your friends and spread the awesomeness! Let's keep the positivity flowing! 🚀✨
@vigneshkumars8937 Thank you for your kind words! Your support means a lot. 😊 I have covered basic actions in Playwright, and addressing advanced actions is part of the plan. I will be including drag and drop functionality in that section.
@shreyanshjain2347 In 3rd way which I explained, there you can use the page fixture directly, at 29:50 I used the page fixture and also explained why, you can revisit this section starting at 27:30 to get more information.
Hello sir, could you please assist me? I have a scenario with two users: one user logs in and submits a form, and the other user needs to approve it. How can I accomplish this? Your help would be greatly appreciated.
Yes, save and reuse authentication worked for other open source project but it didn't worked for my project ,Sir I am working on a project which is related to security ,here issue is one cookie is generated with that csrf token is also generated after login the token gets expired and we cannot reuse the cookie or or csrf token.And there is case where I submit the application form and then user has logout and another user have to login and then approve the form.. How should I deal this scenario.What should be my approach should I use hooks or is there any better method for this.I have been stuck to this very long.More then 7 days.
@yasirarfath4852 If you're using the Page Object Model (POM) pattern, you can call the login and logout methods at any point in your test. The login method should accept username and password as parameters, allowing you to switch credentials during the test. In my video on Page Object Models, I created a login method that accepts username and password as inputs. You can check it out here: th-cam.com/video/IvaPYWteABc/w-d-xo.html . Feel free to ask any questions in the comments!
Hello, I am facing the following problem. When I use codegen I can capture Cookies and use the authentication state to perform other tests. However, when I try to use the other two ways, a JSON file is generated, but I cannot use the authentication state because the "value" field has no data. Would you help me
@paulofabiano6966 As you are getting blank storage state , what I am able to understand is that you are saving auth state before user is getting logged in properly. Into your Global.setup.js file just after logging in v you should provide waitForUrl and also one assertion for the element which is appearing after logging in successfully. These 2 lines of code should be there before using the storageState method. In this video at 30:49 I have mentioned it, try adding it and let me know the result.
@@WishInfinite Thank you my friend, the problem was with the variable. My code was not correctly inserting the login and password, when I passed the information instead of a variable, the JSON file saved the browser state and I was able to use it in subsequent tests. Thanks again for your help. Have a good day.
You can pass login credentials as by including them in a JSON file. I explain this process in my video at th-cam.com/video/8Xk48boYUJs/w-d-xo.html. If you want to configure different credentials for different environments, you can use DotEnv. I'll be adding a video about this to my playlist.
@@WishInfinite Thanks for the reply. I will look into it. Meanwhile another question, suppose I have different login credentials for different spec and one spec file can even have multiple login session. How can I handle it using global setup? N.B: What is Spec? Suppose I want to run the spec file for Login functionality, then I will run this comment: " npx playwright test --headed --project=chromium login.spec.js" Here, I am referring login.spec.js as spec file.
@@MaksudaIslamLima I would be creating one video for using different credentials for different environment, that should solve your problem of using different login credentials. And for running multiple session you can use parallel execution by setting fullyParallel and workers values in playwright.config.ts file.
@hameethaahamed7933 Can you please share your playwright.config file, global file and test script file on wishinfinite01@gmail.com. I will have a look at it.
I received your mail related to your issue. As you are getting blank storage state , what I am able to understand is that you are saving auth state before user is getting logged in. Into your Global.setup.js file after clicking on submit button you should provide waitForUrl and also one assertion for the element which is appearing after logging in successfully. These 2 lines of code should be there before using the storageState method. In this video at 30:49 I have mentioned it, try adding it and let me know the result.
Playwright with TypeScript Series - th-cam.com/play/PL83cimSRP5ZmwhC6u255huRwSi9tlP-nc.html
Recording Video - th-cam.com/video/JCpYFqdu2-c/w-d-xo.html
Page Fixture Creation Video - th-cam.com/video/hEmTT4FV3-Q/w-d-xo.html
POM with Fixtures - th-cam.com/video/qyCPtbEztvw/w-d-xo.html
Playwright Shorts Series - th-cam.com/play/PL83cimSRP5ZlgDL11AGCufbTmADTOwHhO.html
This video is just awesome......Hats off bro...
@abhishekbhardwaj7764 Thank you so much for the kind words! I'm thrilled you enjoyed the video. Feel free to share it with your friends and spread the awesomeness! Let's keep the positivity flowing! 🚀✨
Just amazing 🎉
Thanks a ton! 😊
Thanks for sharing!
My pleasure!
Thanks sir 😊
Most welcome
explanation was amazing i saw the whole video and apply the concepts really amazing it works 😊 can you give explanation for playwright drag and drop
@vigneshkumars8937 Thank you for your kind words! Your support means a lot. 😊
I have covered basic actions in Playwright, and addressing advanced actions is part of the plan. I will be including drag and drop functionality in that section.
@vigneshkumars8937 here is the video for Drag & Drop in Playwright - th-cam.com/video/Z2yAkGiDmBY/w-d-xo.html.
Keep it up.
Thank you for the encouragement!
Why can't we directly use the page fixture in the global setup file?
Why do we need to get the page using chromium?
@shreyanshjain2347 In 3rd way which I explained, there you can use the page fixture directly, at 29:50 I used the page fixture and also explained why, you can revisit this section starting at 27:30 to get more information.
Hello sir, could you please assist me? I have a scenario with two users: one user logs in and submits a form, and the other user needs to approve it. How can I accomplish this? Your help would be greatly appreciated.
@yasirarfath4852 Do you want to perform above scenario by reusing authentication state ?
Yes, save and reuse authentication worked for other open source project but it didn't worked for my project ,Sir I am working on a project which is related to security ,here issue is one cookie is generated with that csrf token is also generated after login the token gets expired and we cannot reuse the cookie or or csrf token.And there is case where I submit the application form and then user has logout and another user have to login and then approve the form..
How should I deal this scenario.What should be my approach should I use hooks or is there any better method for this.I have been stuck to this very long.More then 7 days.
@yasirarfath4852 If you're using the Page Object Model (POM) pattern, you can call the login and logout methods at any point in your test. The login method should accept username and password as parameters, allowing you to switch credentials during the test.
In my video on Page Object Models, I created a login method that accepts username and password as inputs. You can check it out here: th-cam.com/video/IvaPYWteABc/w-d-xo.html .
Feel free to ask any questions in the comments!
Hello, I am facing the following problem.
When I use codegen I can capture Cookies and use the authentication state to perform other tests.
However, when I try to use the other two ways, a JSON file is generated, but I cannot use the authentication state because the "value" field has no data.
Would you help me
@paulofabiano6966 As you are getting blank storage state , what I am able to understand is that you are saving auth state before user is getting logged in properly.
Into your Global.setup.js file just after logging in v you should provide waitForUrl and also one assertion for the element which is appearing after logging in successfully.
These 2 lines of code should be there before using the storageState method.
In this video at 30:49 I have mentioned it, try adding it and let me know the result.
@@WishInfinite Thank you my friend, the problem was with the variable. My code was not correctly inserting the login and password, when I passed the information instead of a variable, the JSON file saved the browser state and I was able to use it in subsequent tests.
Thanks again for your help. Have a good day.
what if I want to pass the value of login credentials as parameter?
You can pass login credentials as by including them in a JSON file. I explain this process in my video at th-cam.com/video/8Xk48boYUJs/w-d-xo.html. If you want to configure different credentials for different environments, you can use DotEnv. I'll be adding a video about this to my playlist.
@@WishInfinite Thanks for the reply. I will look into it.
Meanwhile another question, suppose I have different login credentials for different spec and one spec file can even have multiple login session. How can I handle it using global setup?
N.B: What is Spec? Suppose I want to run the spec file for Login functionality, then I will run this comment:
" npx playwright test --headed --project=chromium login.spec.js"
Here, I am referring login.spec.js as spec file.
@@MaksudaIslamLima I would be creating one video for using different credentials for different environment, that should solve your problem of using different login credentials.
And for running multiple session you can use parallel execution by setting fullyParallel and workers values in playwright.config.ts file.
how can we implement the same in js, I tried but when using the globalsetup it is not working
@hameethaahamed7933 Can you please share your playwright.config file, global file and test script file on wishinfinite01@gmail.com. I will have a look at it.
I received your mail related to your issue.
As you are getting blank storage state , what I am able to understand is that you are saving auth state before user is getting logged in.
Into your Global.setup.js file after clicking on submit button you should provide waitForUrl and also one assertion for the element which is appearing after logging in successfully.
These 2 lines of code should be there before using the storageState method.
In this video at 30:49 I have mentioned it, try adding it and let me know the result.