ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก

🎭 Playwright vs ✅ Selenium | Browser Automation 2021 Showdown

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ส.ค. 2024
  • In this episode, we draw the line: mature and experienced vs. young and energetic? Which is the automation tool of choice: 🎭 Playwright or ✅ Selenium? With my trusty scale ⚖️, we'll weigh some of the key features of these two: browser support, languages, web interactions, speed, community, waiting and so on.
    Who's gonna win? Could be Selenium, or maybe Playwright? Test Automation or automated testing? Nobody knows 👀 ...
    👉 Head over to testopic.com/pl... to join Playwright NTTN.
    Other mentioned links
    - Checkly speed testing methodology blog.checklyhq...
    - Simon Stuart 2016 email - lists.w3.org/A...
    Chapters:
    00:00 Intro
    00:41 Playwright in 30 seconds
    01:17 Official browser support
    02:05 Language Bindings
    02:40 Basic Web Interactions
    04:48 Speed
    06:03 Speed: Starting the browser
    07:58 Waiting
    10:37 Community Support
    11:41 Playwright native
    13:06 Outro

ความคิดเห็น • 137

  • @terencetcf
    @terencetcf 2 ปีที่แล้ว +106

    having used both in real world projects for the past few years... once you get used to Playwright, there is almost like no going back. Is so much cleaner and easier to work with.

    • @eg8580
      @eg8580 2 ปีที่แล้ว +3

      i 100% agree

    • @dheerajchoudhary4373
      @dheerajchoudhary4373 2 ปีที่แล้ว

      Does it have support for cross browser and parallel testing like Selenium grid?

    • @terencetcf
      @terencetcf 2 ปีที่แล้ว +4

      @@dheerajchoudhary4373 yeah and quite a lot faster

    • @dheerajchoudhary4373
      @dheerajchoudhary4373 2 ปีที่แล้ว

      @@terencetcf hey terence, can you please provide specific docs link for this. Thanks in advance

    • @markcuello5
      @markcuello5 2 ปีที่แล้ว

      Yeah, seems like Hi-Tech stuff.

  • @Sheriour
    @Sheriour ปีที่แล้ว +7

    I'm very happy to have found your channel and very sad to see there isn't much activity here anymore. I think you have a very unique style of delivery, equally informative and entertaining, which is not something easy to find. Very good video 👍

  • @naveenautomationlabs
    @naveenautomationlabs 3 ปีที่แล้ว +18

    Awesome video @victor. Great comparison, very well presented. For me Selenium is still my first love for web automation.

    • @Testopic
      @Testopic  3 ปีที่แล้ว +3

      Thank you so much, Naveen! I've been following your content for a while now, so it means a lot coming from you!

    • @naveenautomationlabs
      @naveenautomationlabs 3 ปีที่แล้ว +1

      @@Testopic Keep sharing more content. Looking forward to see a full series on Playwright...

    • @markcuello5
      @markcuello5 2 ปีที่แล้ว

      What exactly is `Web automation`?

    • @radovanbabjak7903
      @radovanbabjak7903 2 ปีที่แล้ว +1

      @@markcuello5 automated tests for your code testing the functionality for you.

  • @milan_clips
    @milan_clips 5 หลายเดือนก่อน +1

    I humbly request you to please keep posting more of such content and I really loved your presentation style. Keep up the good work.

  • @fabiel4721
    @fabiel4721 3 ปีที่แล้ว +15

    I see more potential on Playwright in my opinion keep up with them uploads it helps a lot for new devs like me, great video man.

    • @Testopic
      @Testopic  3 ปีที่แล้ว +1

      Yes, it does have a lot of potential. Thanks for the support, Fabiel!

  • @ivopdimitrov
    @ivopdimitrov 3 ปีที่แล้ว +8

    I want to mention that most of the Selenium based frameworks are having really nice features and additions to Selenium library. So working with such framework is making your automation testing efforts easier. So guys please do not only look at Selenium disadvantages or missing features. Most of them are handled in automation frameworks.

    • @Testopic
      @Testopic  3 ปีที่แล้ว +5

      Hello Ivo, I agree. There are serious advantages that Selenium has, based on its maturity. One of these advantages is the strong community behind it, which often results in cool libraries and frameworks built around it.
      But there's a flipside to this as well. Already built frameworks are often cluttered with functionality which most of us will never use. And an even bigger problem occurs when you're already committed to such a framework and you do need something custom from it, only to find out it's hard/impossible to extend due to the bad programming behind the scenes.
      So, my suggestion is not to rely on frameworks blindly. The decision between an out of the box framework or a lightweight custom one lies on each of us, based on one's own context.

    • @markcuello5
      @markcuello5 2 ปีที่แล้ว

      What do you mean by `Selenium library`?

  • @DanielIonutMihalache
    @DanielIonutMihalache 2 ปีที่แล้ว +11

    I recently ran into a drag and drop issue with selenium when you want to drag an element from a frame to another frame. Actions class simply doesn`t do the job.
    I then tried playwright which just worked right away. Big plus for playwright

    • @bgd_surf
      @bgd_surf 8 หลายเดือนก่อน

      so you are saying that you do not know how to use selenium right. This is your lack of knowledge not superiority of plwright

  • @dand4485
    @dand4485 2 ปีที่แล้ว +24

    Interesting review, i might differ on a few points mentioned... I've been a software developer/tester for 30years, if my life depended on stability and reliability hands down Playright is the winner. Often selenium, especially with newer javascript libraries, angular, react, vue, svelte and others, good luck getting selenium to be reliable. Go back 10 years ago, selenium was fine, but no longer with the virtual Dom... For this reason Playwright, especially with their switch to locators and discouraging ElementHandle, would assert really makes Selenium obsolete. And to be fair, your review was before this, might assert the switch in Playwright was a month or three after your review came out. Can't help thinking of how many "StaleElementExceptions" i get or need retry logic in selenium tests, not so with Playwright.

  • @letcode
    @letcode 3 ปีที่แล้ว +7

    Playwright is awesome with its test runner.
    We can do lots of things, visual comparison. Reports with screenshot and video out of the box, and lot of more features.
    The locator strategy which is huge comparing to selenium.

    • @Testopic
      @Testopic  3 ปีที่แล้ว +2

      Agree, the test runner deserves a presentation on its own! Even the idea of having a dedicated test runner for a browser automation library is quite original. I'm quite curious how it will go.

    • @markcuello5
      @markcuello5 2 ปีที่แล้ว +2

      What is `Locator strategy`?

    • @letcode
      @letcode 2 ปีที่แล้ว

      @@markcuello5 finding element in a webpage, like linktext button inputs and others.

    • @Dethas1991
      @Dethas1991 ปีที่แล้ว

      Yeah, i was doing Selenium for a long time and first thing i did after i got used to it was Locator class and automated waiters for all actions/asserts, it was 1k+ lines of additional code. Playwright has it out of the box.

  • @SongforTin
    @SongforTin ปีที่แล้ว +2

    Hey this video was so much fun to watch. Hope you will produce more videos, you're a great teacher.

  • @sv3163
    @sv3163 ปีที่แล้ว +2

    Absolutely great explain and show up! 👍 Feeling like i read good article ❤

  • @nmstoker
    @nmstoker 2 ปีที่แล้ว +3

    Excellent video - thanks Victor! I liked that you weigh things up fairly, with just the right amount of detail, and highlight how any choice about which is "better" ultimately has to be up to the viewer (/user)

  • @pavlohernandez
    @pavlohernandez 2 ปีที่แล้ว

    Information: 10tone of voice, speed, gestures: perfect. new subscriber

  • @NoahElRhandour
    @NoahElRhandour 2 ปีที่แล้ว +2

    this was very educational, thank you so so much for the knowledge and all the effort that was necessary to produce such a video

  • @Yoyo-gf3oi
    @Yoyo-gf3oi ปีที่แล้ว +3

    As a user of both Selenium and Playwright at work, I must say Playwright is far superior, much faster, better documentation, and a lot less flaky. Once the Playwright community grows, it will become the industry standard without a doubt.

  • @andreasvanbergen9696
    @andreasvanbergen9696 9 หลายเดือนก่อน

    Maestro! Thank you so much for this video! For my current assignment I am looking for the best candidate regarding automated testing tools....this video helps me alot! Thanks! 👍

  • @andre-le-bone-aparte
    @andre-le-bone-aparte ปีที่แล้ว +1

    Just found your channel. Excellent Content - Another sub for you sir!

  • @user-qw9cz7ff2o
    @user-qw9cz7ff2o ปีที่แล้ว +1

    This is the information I have wanted for a long time. I have been to so many tutorials and sites for learning. You are outstanding for me. Short and relevant info. I salute you for this. Best regards from Sweden.

  • @jakef7445
    @jakef7445 ปีที่แล้ว +1

    I am just getting into the automation world but from what I have seen from both Playwright looks the easier tool to use. I will be looking at trying both though.

  • @Rahul-sz6pf
    @Rahul-sz6pf 3 ปีที่แล้ว +1

    Good informative content by the comparison. It is really awesome to get much knowledge on the latest automation tool.

    • @Testopic
      @Testopic  3 ปีที่แล้ว

      Glad it was helpful Rahul!

  • @azimmermanm
    @azimmermanm 2 ปีที่แล้ว

    This was a fantastic comparison. You conviced me to give it a go to Playright

  • @mohammadfallah.rasoulnejad5379
    @mohammadfallah.rasoulnejad5379 ปีที่แล้ว

    for the "auth reuse" you can do that in selenium too. either with chrome profiles or even saving cookies into a file using pickle or even json files. but It can be a plus if its natively supported by the framework I can agree on that.

  • @urbainvalere4932
    @urbainvalere4932 ปีที่แล้ว

    hello clever man we need more videos please your explanation are so great to understand

  • @retrodad9390
    @retrodad9390 2 ปีที่แล้ว

    And Playwright auto-tests almost everything in their repo, so it will be getting better and better without compromising quality and adding new functionality can be done faster in the future with same quality instead of doing less and less frequent releasing. Thanks for the video!

  • @sagarsjdjfn
    @sagarsjdjfn ปีที่แล้ว

    the man knows what he is talking about. One question: how is playwrite when data-driven framework is used like google sheets or excel ?

  • @iulianmocanu3269
    @iulianmocanu3269 ปีที่แล้ว

    thanks mate, awesome comparison and explanations. cheers

  • @ciprianreghina
    @ciprianreghina 2 ปีที่แล้ว +6

    Great comparison and thanks for the video. Two corrections: First, Selenium also supports PHP language and second, the analogy with Chrome Incognito windows is not precise, since all incognito windows are sharing the same session (between them). Opening a new Incognito window while you are logged in into another incognito window will keep you authenticated. Thanks !

  • @shinrafahell
    @shinrafahell 2 ปีที่แล้ว

    Thank you sir for this amazing video it helped me to better understand the benefits of playwright.

  • @superromario
    @superromario ปีที่แล้ว +1

    Playwright is asynchronous - thats huge advantage

    • @alantest1521
      @alantest1521 6 หลายเดือนก่อน

      Why is that?...humans or users to be precise use web apps synchronously.

  • @EthanHawk100
    @EthanHawk100 2 ปีที่แล้ว

    A great and informative video. Keep up the good work!

  • @sv3163
    @sv3163 ปีที่แล้ว +1

    I chose Playwright! ❤👍

  • @BadBackOz
    @BadBackOz 8 วันที่ผ่านมา

    It's so easy to configure your own WebElement objects with custom methods in order to control the waiting, polling, validating, etc. I don't understand the knock on Selenium from this standpoint. Have been using it for years and no flakiness issues introduced besides those from poor developers. Will be diving into Playwright shortly and see how that goes though.

    • @BadBackOz
      @BadBackOz 19 ชั่วโมงที่ผ่านมา

      Have been exploring Playwright for a few days and like it so far. Definitely spins up a bit quicker, but wouldn't necessarily say that the code is cleaner than framework and language I have been using for Selenium, at least not in JS.

  • @Machtyn
    @Machtyn ปีที่แล้ว

    Nice video, you've got a new subscriber! I'm going to check out your other vids very shortly.

  • @omkarbhandare5508
    @omkarbhandare5508 28 วันที่ผ่านมา

    vote for Selenium vs playwright vs cypress

  • @user-tw9oo1kd9g
    @user-tw9oo1kd9g 6 หลายเดือนก่อน

    Thanks a lot for the such useful video!

  • @damianperez7736
    @damianperez7736 2 ปีที่แล้ว

    PlayWright has automatic code generator, that's just another next level

  • @depositionsandstuff7465
    @depositionsandstuff7465 2 ปีที่แล้ว +1

    Is this channel still active? Anyone know if Victor is OK or just maybe not uploading content? Asking as I shot an email to the posted email address and it was bounced back. Also, it has been about 8 months since the last upload.
    I was really hoping for some more Playwright content as we are vetting this solution here. This channel has a few really well put together / easy to follow demos.

  • @chrisbrm2438
    @chrisbrm2438 ปีที่แล้ว +1

    What about popups from the OS? For example PIN dialogues to authenticate in a webpage. Can you handle it with playwright?

  • @foxfull100
    @foxfull100 2 ปีที่แล้ว

    hope you can have tutorial about Playwright native features and the use cases of them that you mentioned in the video

  • @johnc0de
    @johnc0de 2 ปีที่แล้ว

    Amazing video!, Thank you so much!

  • @arnowinter462
    @arnowinter462 10 หลายเดือนก่อน

    Using both of them, I now absolutely prefer Playwright because it has some nice features that Selenium does not (at least not so easily).
    - hover() instead of ActionChains
    - shadow DOM handling
    - selectors in
    - expect_request() to handle network requests
    - automatic scroll into view if needed
    - etc., etc. ....
    And regarding my test scripts, it is simply faster and more stable (no more WebdriverExceptions when the webdriver decides to freeze... A/K/A "Timed out receiving message from renderer")... I assume that all Selenium users are aware of this issue... ;-)

  • @bgd_surf
    @bgd_surf 8 หลายเดือนก่อน

    So overall, Selenium still rocks after all this years.

  • @wagnermoreira786
    @wagnermoreira786 ปีที่แล้ว

    forgot to mention that selenium produces a bunch of flaki tests, it doesn't have auto wait like cypress and playwright does, because of that it doesn't handle async code properly. for web page testing I think Selenium is showing it's age it seems. Cypress and Playwright are much better options

  • @hamidhos8101
    @hamidhos8101 ปีที่แล้ว

    Hello. Thank you for the great educational videos you make.
    Which of the following software do you choose to test modern software?
    Cypress or Playwright or Selenium ?

  • @TomTom-ty5ej
    @TomTom-ty5ej 2 ปีที่แล้ว

    Thanks mate! Great job!

  • @allaboutunreal8666
    @allaboutunreal8666 ปีที่แล้ว

    Great video. Thanks Man : )

  • @skyring9357
    @skyring9357 2 ปีที่แล้ว +4

    Nice video..I explored playwright 2 weeks ago and started to build with Python/pytest. Will be good if you have videos for playwrights Python soon. Thanks

    • @Testopic
      @Testopic  2 ปีที่แล้ว +3

      Thanks for the feedback and suggestion!
      Playwright with Python is a good combo and I'm thinking of making a video about it. What would you be interested in?

    • @danielrosas2240
      @danielrosas2240 2 ปีที่แล้ว

      Dinamic web scraping

    • @joseluispaukner7817
      @joseluispaukner7817 2 ปีที่แล้ว

      @@Testopic I managed to stack python with playwright using vs code and pytest-BDD... some issues whith debbugging in vs code, but getting there

  • @Th3Luz
    @Th3Luz 2 ปีที่แล้ว

    Good knowledge. Thx Man!

  • @SAN-un3vo
    @SAN-un3vo 2 ปีที่แล้ว

    You make an wonderful video.good job

  • @izrailmoiseevic2844
    @izrailmoiseevic2844 2 ปีที่แล้ว

    cool review! thanks!

  • @rodalovzep
    @rodalovzep ปีที่แล้ว

    Excelent comparison.

  • @andrefernandes5162
    @andrefernandes5162 2 ปีที่แล้ว

    very good information!! congrats

  • @piano_dreamerc_moll2475
    @piano_dreamerc_moll2475 2 ปีที่แล้ว

    great explanation and thank you

  • @gurjeetbains3691
    @gurjeetbains3691 2 ปีที่แล้ว +1

    Playwright is the way to go for me

  • @Innercynic
    @Innercynic ปีที่แล้ว

    Saying typescript is just a superset of javascript is a bit like saying that scala is just a superset of java.
    On the contrary, the TS support is the shining jewel, and probably how most people are writing playwright tests.

  • @rayprusia4753
    @rayprusia4753 2 ปีที่แล้ว

    Thanks for the video.

  • @IntricateMoon
    @IntricateMoon ปีที่แล้ว

    THANK YOUU VIKTORRRRR!!!

  • @sv3163
    @sv3163 9 หลายเดือนก่อน

    i still use Playwright! ❤❤❤👍

  • @samrenteria7266
    @samrenteria7266 ปีที่แล้ว

    Great Video!

  • @joaogoncalves2450
    @joaogoncalves2450 2 ปีที่แล้ว +2

    Amazing video, thank you. I'am trying to use the playwright but how can integrate a nice debugger in IntelliJ (with robot framework), do you have any idea? I'm using the word "debug" to force the code to stop :(

    • @eg8580
      @eg8580 2 ปีที่แล้ว

      +1 I'm curious to know as well

  • @RudraDamruWala
    @RudraDamruWala 2 ปีที่แล้ว

    How Playwright can be integrated with other test requirement like working with excel, pdf, database etc ?
    As in Selenium-Java, its in the end java based framework that can be extended with Apache PIO, Rest Assured, JDBC etc to have complete robust solution. I am very new to JS based test tools hence no idea how can be work with excel, database, API etc along with web app tests.

  • @j.raimundosilva2101
    @j.raimundosilva2101 ปีที่แล้ว

    I've discovered something that playwright does better then selenium: using proxies. Its very easy to use proxies that needs authorization. On selenium i had to use a bunch of third party libraries.

  • @mohammadtanweerahmed3636
    @mohammadtanweerahmed3636 ปีที่แล้ว

    Have you made any course on playwright ?

  • @NerdyThrowbackTech
    @NerdyThrowbackTech 2 ปีที่แล้ว

    Fantastic video

  • @Machtyn
    @Machtyn ปีที่แล้ว

    I guess Selenium gets the nod for browser support. Probably the main selling point is that it supports the old "pre-chromium" version of Edge. At this point, though, I feel sorry for anyone that still has to support Internet Explorer. And I hope that those computers are NOT on the public facing Internet.

  • @theTrigant
    @theTrigant 2 ปีที่แล้ว

    Why do I have to use Chrome for incognito tabs. Other browser have icognito modes aswell!

  • @AmodeusR
    @AmodeusR ปีที่แล้ว

    I didn't like this comparison because it doesn't consider ease of use. I was watching a video on Playwright and that was enough to be impressed at how simple is Playwright syntax in comparison to Selenium, from the code itself to even the imports and environment preparation (that requires you to download a webdriver whenever the broswer you use is updated). It's like going from hell to heaven, but it's not considered in the video.

  • @mohammadfallah.rasoulnejad5379
    @mohammadfallah.rasoulnejad5379 ปีที่แล้ว

    Im curious if its possible to capture web api requests by modern dynamic websites like ReactJs backend calls on scrolling the page or load more functionality requests. is it possible in playwright as it is possible with selenium-wire? can anyone confirm this feature for me?

  • @adipear
    @adipear 2 ปีที่แล้ว

    Playwright for sure !

  • @vaster1142
    @vaster1142 10 หลายเดือนก่อน

    Selenium supports php as well

  • @daryn86
    @daryn86 ปีที่แล้ว

    What happened to posting every 2 weeks??? I really like your videos 😒

  • @depositionsandstuff7465
    @depositionsandstuff7465 ปีที่แล้ว

    Been a few months since the last request for an update. Anyone have any information on Victor and the status of this channel?

  • @over1498
    @over1498 ปีที่แล้ว +1

    Id argue that there’s no universe where the language support point should go to Selenium because “Ruby is more of a language than Typescript”
    Typescript makes up the bulk of enterprise web apps these days, it’s used exponentially more than Ruby, and it’s not even close (more than almost any other language actually) So are devs going to use the language that is already required of them? Or flipping RUBY.
    It’s like saying my homemade custom Hotwheels company started in my garage is more of a car company than Lexus because technically Lexus is just a Toyota.

  • @senator557
    @senator557 2 ปีที่แล้ว

    great vid, thanks I know the point that is not supporting IE

  • @ornelfranck
    @ornelfranck ปีที่แล้ว

    Nice

  • @GauravSingh-bc7zm
    @GauravSingh-bc7zm 2 ปีที่แล้ว

    Nailed it.

  • @coxismail734t
    @coxismail734t 2 ปีที่แล้ว

    Hi bro thanks for this video a question how can i activate vpn in webdrive opera ? (Selenium python )

  • @heyrmi
    @heyrmi 2 ปีที่แล้ว

    Video quality is high!

  • @criscarlod
    @criscarlod 2 ปีที่แล้ว

    Is the playwright supports mobile testing automation? Thanks

  • @RaviSalunkhe85
    @RaviSalunkhe85 2 ปีที่แล้ว

    Selenium all the way but will try Playwright for sure.
    I personally don't like JS/TS so until it's cooked properly for Java or maybe Python...I might just wait.

    • @jeremycattau1563
      @jeremycattau1563 2 ปีที่แล้ว

      Does Playwright Java not have all the capability of JS/TS? Asking because I don't know.

    • @RaviSalunkhe85
      @RaviSalunkhe85 2 ปีที่แล้ว

      @@jeremycattau1563 JS/TS is a first class language for playwright so you get all the latest/greatest features released there.
      It does take a while to get available with python and java bindings.

    • @jeremycattau1563
      @jeremycattau1563 2 ปีที่แล้ว

      @@RaviSalunkhe85 I'm now seeing that the test runner doesn't work with Java. I wonder if they ever plan to do so.

    • @RaviSalunkhe85
      @RaviSalunkhe85 2 ปีที่แล้ว

      @@jeremycattau1563 Also, it’s only junit they support for now. Java is the main language which majority of automation folks use. Any tool coming up should make sure to support this stack and it’s related modules.

  • @ollie_the_wandererli7523
    @ollie_the_wandererli7523 ปีที่แล้ว

    this year, the sites to be automated to make money are so hostile to bots that i don't think PlayWright can do the job. Because in Selenium, there's Undetected Chromedriver

  • @missionyoungblood
    @missionyoungblood ปีที่แล้ว

    Based on all the comments on here I am going to give Playwright a go!

  • @j.k.ravshanovich
    @j.k.ravshanovich ปีที่แล้ว

    With Playwright say goodbye to flaky tests.

  • @TheVincent0268
    @TheVincent0268 ปีที่แล้ว

    Thanks for the comparison! Is it me or is the sound not well recorded? It jumps up and down between loud and silent parts, what makes some words hard to understand.

  • @joshuasmith2814
    @joshuasmith2814 2 ปีที่แล้ว

    Cypress it is then...

  • @fomodog2698
    @fomodog2698 2 ปีที่แล้ว

    Playwright does not support extensions.

  • @godamkeras4144
    @godamkeras4144 2 ปีที่แล้ว

    never know Shavo Odadjian also a programmer 😅

  • @MashenkaRust
    @MashenkaRust 2 ปีที่แล้ว

    Виктор?

  • @markcuello5
    @markcuello5 2 ปีที่แล้ว

    Help me

  • @Monkeydew1o2
    @Monkeydew1o2 ปีที่แล้ว

    Selenium doesn't even work as intended. Use playwright....

  • @encapsulatio
    @encapsulatio 2 ปีที่แล้ว +1

    Who is the BDD equivalent of Playwright?

    • @Testopic
      @Testopic  2 ปีที่แล้ว +2

      Hey! I'm afraid Playwright on its own can't do BDD. You would need to integrate it with a different tool, like Cucumber, to use BDD-specific features. Tally Barak wrote some material about this: tally-b.medium.com/e2e-testing-with-cucumber-and-playwright-9584d3ef3360. To make things easy, she published a nice template that you can use to start new projects: github.com/Tallyb/cucumber-playwright

    • @encapsulatio
      @encapsulatio 2 ปีที่แล้ว

      @@Testopic Thank you for those links. What about test case management? are there any open source projects that are "next gen" that we should keep our eyes on?

  • @harishkce1989
    @harishkce1989 ปีที่แล้ว

    I believe Playwright with Java does not have softassertion alike selenium - Playwright (assertThat - fails and stops execution at that point) - or i am not sure if it depends on the test runner framework we use (alike testng has org.testng.asserts.SoftAssert) ???

  • @MrUploader14
    @MrUploader14 2 หลายเดือนก่อน

    In fairness at 10:04 this guy intentionally makes selenium more complicated. A better and more readable was to write the code would be.
    wait = webdriverwait(driver, 10).until(expectedcontions.elementtobeclickable(by.xpath("//locator")))
    Wait.click()
    When you're using unexpected conditions you're already locating the element so the third line is completely unnecessary and redundant and you can shorten it further by importing expected conditions as EC. So what I write is:
    wait = webdriverwait(driver, 10).until(EC.elementtobeclickable(by.xpath("//locator")))
    Wait.click()

    • @BadBackOz
      @BadBackOz 19 ชั่วโมงที่ผ่านมา

      Just follow the Page Object Model and on top of that create an Element object. Write your own methods in there with the appropriate wait times and checks for each interaction type. For example, element.click() should have code in it to wait for object to be visible. There aren't that many commonly used actions and you can simply write your validators this way as well.

  • @markcuello5
    @markcuello5 2 ปีที่แล้ว

    Help me