#4 - ThreadLocal Concept with Page Object Model || Playwright & Java

Поділитися
Вставка
  • Опубліковано 3 гру 2024

КОМЕНТАРІ • 28

  • @mouthecutest
    @mouthecutest 2 роки тому +2

    Thanks a lot..all your tutorials are very useful ..Eagerly Waiting for the next episode....

  • @ABAutomationHub
    @ABAutomationHub 2 роки тому +2

    Thanks for creating video on ThreadLocal concept .. Very Useful !

  • @sairamk8787
    @sairamk8787 Рік тому +1

    We just implemented the thread local in our playwright script. We were able to launch the browser in parallel but getting null pointer exception in browse.close. Also unable to perform same operation in azure pipeline.

  • @pranavhanwante5301
    @pranavhanwante5301 3 місяці тому

    Please make a video on the same thread local with Java.

  • @aparnan1272
    @aparnan1272 11 місяців тому

    ThreadLocal variables are declared static but they are re-initialzed every time in the initialize method. So it defies the use of static

    • @naveenautomationlabs
      @naveenautomationlabs  11 місяців тому

      Yes it needs to be reinitialized with every thread so that each thread will get the local copy of context.

  • @manikandank7090
    @manikandank7090 Рік тому

    @naveenautomationlabs could you please share the video link where thread local concept implemented in selenium framework

  • @dileephpentapati8535
    @dileephpentapati8535 Рік тому

    Thanks you so much.

  • @shashankpandey7949
    @shashankpandey7949 6 місяців тому

    Threads are not closed thus may cause memory leaks,moreover due to wrong implementation the screenshots are not getting attached to allure report

  • @sounaknandi1393
    @sounaknandi1393 2 роки тому

    Hey Naveen, Don't we need to make the get methods synchronized? getPage, getBrowserContext, getBrowser

    • @naveenautomationlabs
      @naveenautomationlabs  2 роки тому +1

      Yes we can make it synchronized. But not needed, TL will alwys return the local copy of instance.

    • @sounaknandi1393
      @sounaknandi1393 2 роки тому +2

      @@naveenautomationlabs thank you Naveen. Playwright is quite in demand and noone has such good content as you do till now. I am refering your cucumber series and replacing selenium with playwright for creating a framework at my work. Eagerly waiting for your upcoming videos and your tips. Thanx again for always guiding us.

  • @MohammedSameer-rx5rz
    @MohammedSameer-rx5rz Рік тому

    After this can you please do a video of how to set up listeners, extent reports, and take screen shorts. in GitHub I saw code sir, I want to know how you have done from scratch after the Login page in the POM model framework. Thank you so much for creating videos, These are very useful for all Automation engineers sir.

  • @ahamedabdulrahman
    @ahamedabdulrahman 2 роки тому

    This is exactly how I have implemented in my current project. Have a question here.
    Why should we have Playwright as static ThreadLocal? Just static should also work, right?
    Its like for my complete suite, am using single Playwright static object.
    So we just implement ThreadLocal on Browser, BrowserContext, Page for each test case and reuse same Playwright object. That should work, right?
    That way, serial execution is working fine but parallel is failing. Any idea why that’s so?

    • @naveenautomationlabs
      @naveenautomationlabs  2 роки тому

      Static creates a common copy of playwright for all the objects. Parallel execution wont work with static playwright. Better you make playwright with static threadlocal.

    • @ahamedabdulrahman
      @ahamedabdulrahman 2 роки тому

      @@naveenautomationlabs Every BrowserContext created by Playwright is a new Window without any session data, right? So, logically it should work, isn’t it?

  • @abhishekchoudhary8119
    @abhishekchoudhary8119 Рік тому

    Hi
    I wanted to understand why we need to implement thread local if there is no test data dependency.
    I mean in this framework each class creates its own playwright object so if i run 20 classes in parallel they will have their own playwright or browser objects right ?
    Please explain more on this as I am a little confused

    • @rsenytsya
      @rsenytsya 4 місяці тому

      yep, in this case you are right, each test class will create its own playwright object so basically there is no need for threadlocal here

  • @VGuardianOfTheGalaxy
    @VGuardianOfTheGalaxy 2 роки тому

    @naveen seems like your telegram group is deactivated. Please share the updated invite link

  • @srinivasanbalan3646
    @srinivasanbalan3646 3 місяці тому

    Hi Thanks Naveen for all those, I am a new to start, could you please any one help me. how to use auto login in the pom if more than 2 pages and tests with threadlocal.
    However in the most of the samples and video only explained 2pages alone ..
    So please help anyone and appreciate in an advance!!!

  • @saurabhsrivastav902
    @saurabhsrivastav902 Рік тому

    Hi Naveen , I want to run parallel execution using same browser. In the testng file I have configured as "" ,so 2 browsers get launched, but one of them gets closed and gives error message as " com.microsoft.playwright.PlaywrightException: Object doesn't exist: handle@dc6f831c1ddfdf763239053172c24222" . Can you help with any ref why this error is displayed??

    • @akhilvutukuri2180
      @akhilvutukuri2180 Рік тому

      Hey, I have been getting the same error and even I'm not sure how to resolve this.
      Naveen, Can you please help us out there? We would be thankful..

    • @akhilvutukuri2180
      @akhilvutukuri2180 Рік тому

      Also, @saurabhsrivastav902 please let me know if you got the resolution for this.

  • @AnkitSingh-vy7gj
    @AnkitSingh-vy7gj Рік тому

    not able to understand even little . Someone please help this one with some other video.

    • @naveenautomationlabs
      @naveenautomationlabs  Рік тому

      You need to improve your java knowledge first to learn these concepts.

    • @AnkitSingh-vy7gj
      @AnkitSingh-vy7gj Рік тому

      @@naveenautomationlabs Core i know but still what should i do ? Shall i watch again or you would help me with some more related video or tutorial

    • @naveenautomationlabs
      @naveenautomationlabs  Рік тому

      If you know java 8 features then you should be able to understand this basic concepts as well.

  • @balaji_r
    @balaji_r Рік тому

    how do I set default timeout with threadlocal browser context? I used to set with browserContext.setDefaultTimeout(60000) but with threadlocal, where should I define it? @naveenautomationlabs