What is Assertion in Selenium | Selenium JavaScript Tutorial | LambdaTest

Поділитися
Вставка
  • Опубліковано 1 лют 2025

КОМЕНТАРІ • 25

  • @pabloperalta1994
    @pabloperalta1994 9 місяців тому +1

    I had to downgrade the chai version to 4.2.0 by changing it on the package.json file and running an npm install. Soo it would run with the import you use in the video.

    • @LambdaTest
      @LambdaTest  8 місяців тому

      Hi there! Thanks for sharing your experience. It's great to hear that you found a solution by downgrading the chai version to 4.2.0. This is indeed one way to resolve compatibility issues with certain imports.
      For anyone else encountering similar issues, this approach can help maintain compatibility with the code shown in the video. If you have any more questions or need further assistance, feel free to ask. Happy coding!

    • @inkybox1561
      @inkybox1561 8 місяців тому

      This worked perfectly, thank you!

  • @marina305
    @marina305 3 роки тому +2

    Thanks a lot! Ryan is one of the best teacher of this topic:)

  • @udosamuel653
    @udosamuel653 3 роки тому +2

    Thanks a lot for this. I like how you go slowly explain stuff in details. I am a beginner that really want to learn test automation. Keep up the good work.

    • @LambdaTest
      @LambdaTest  3 роки тому

      Thanks udo for your kind words

  • @mac-cx9cy
    @mac-cx9cy 6 місяців тому

    Thanks for the video

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

    Oh dude, I love you :D
    Thanks!

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

    Thank you so much

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

      I'm glad you enjoyed the video!
      Subscribe to our channel to never miss an update on the upcoming tutorials! ✨

  • @ericrogers5559
    @ericrogers5559 3 роки тому +1

    Thanks so much for these videos! They have helped me understand these tools and their ability to test far more than before. Thanks again, Ryan! Please do some automation videos for electron and selenium. :D

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

    Your vids are a lifesaver! Thank you!
    What should I type if I'm going to use just assert style?
    var assert = require("chai"); -> this doesn't feel right, since assert variable was already created?

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

      Hey Bellatrix 👋🏻
      Thank you for liking our videos ❤️
      If you want to use just the assert style with Chai, you can use
      var assert = require("chai").assert;
      This will import only the assert style from the Chai library and assign it to the assert variable. You can then use the assert variable to write your assertions in your test code.

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

      @@LambdaTest wait, but line higher there is constant variable called assert, so I shouldn't be able to overwrite it with new code. Or with chai I don't need built-in assert?

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

      Aaah, just watched my answer in the next video! You were reading my mind a year ahead! 😂 Thank you again!

  • @thanhnhanhuynh2240
    @thanhnhanhuynh2240 3 роки тому +1

    Thank alot

  • @aktar749
    @aktar749 3 роки тому +1

    let todoText= await driver.findElement(By.xpath("//li[last()]")).getText().then(function(value){
    return value
    });
    how do this code works and not give you assertion error????

    • @LambdaTest
      @LambdaTest  3 роки тому +1

      Hey Ali, Let us get back to you on this.

    • @aktar749
      @aktar749 3 роки тому

      I dont think this is a valid xpath.

    • @ericrogers5559
      @ericrogers5559 3 роки тому

      Why would this give you an assertion error? Can you share the actual error?

    • @LambdaTest
      @LambdaTest  3 роки тому

      Ali, This Code snippet only reads the text from the web page and returns it as a variable. There is no assertion added here.