Write Tests - WebdriverIO Tutorial | #3

Поділитися
Вставка
  • Опубліковано 14 жов 2024
  • Support this channel by buying me a cup of coffee ☕️ -
    www.buymeacoff...
    #webdriverio #tests #javascript
    In this video, we will begin to write our tests from scratch. We will cover different ways to access elements, learn about CSS selectors, and create our own custom selectors for our tests.
    In this tutorial series, we will be building a fully functional test automation framework in JavaScript using WebdriverIO and integrate our tests with Mocha, Chai, Allure, BrowserStack, JUnit, and Jenkins.
    • WebdriverIO - Tutorial...
    All the code is available on Github - github.com/aut...
    ........................
    📧 Subscribe to my mailing list for all the latest updates -
    automationbro....
    ✒️ Check out my blogs at - automationbro.com
    🚀 Enjoying my content and would like to support my work? Why not buy me a coffee! or Subscribe to this channel! 🚀
    www.buymeacoff...
    www.youtube.co...
    Thanks for watching :)
    Automation Bro

КОМЕНТАРІ • 65

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

    Hi All, for those of you getting errors such as 'addValue is not a function' are due to some of the changes that happened with WebdriverIO sync mode. I created a video on that explaining what the change is and what you will need to do to get your code working with latest WebdriverIO - ua-cam.com/video/Jk6giesyECA/v-deo.html

  • @JagjeetSingh-pe7ow
    @JagjeetSingh-pe7ow 4 роки тому +2

    Amazing video, got my code to work for the first time. Really excited.
    Would love to have a short video on creating custom CSS. Thank you.

    • @sdetunicorns
      @sdetunicorns  4 роки тому +3

      Great to hear that!
      I'll be putting a video out on commonly used selectors and how to create your own custom selector. Stay tuned.

    • @JagjeetSingh-pe7ow
      @JagjeetSingh-pe7ow 4 роки тому

      @@sdetunicorns Awesome. Looking forward to it

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

    Thank you very much, I really appreciate your work, this is very useful for me, God Bless you!

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

    This is really good...thanks a lot for posting these excellent videos.

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

    Great Thank you !!

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

    This is really good...thanks a lot.Awsome.

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

    Awesome teaching bro.

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

    Thank you! Very good lesson!

  • @eleazarramirez154
    @eleazarramirez154 4 роки тому

    Excellent Video !! Thanks

  • @AdityaKumar-iy8vl
    @AdityaKumar-iy8vl 2 роки тому

    I am eagerly waiting for async method and please make the videos on mocha framework as it is required in my project

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

      Hi Aditya, I have a full course on this already on Udemy which you can check it out, if interested. You can use the coupon linked - www.udemy.com/course/webdriverio-complete-beginner-course/?couponCode=TEST-DEC-013

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

    Hi Dilpreet, I really appreciate the video ...Thank you! Can you please share which extensions you installed in VSC? Thank you, again.

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

      Thank you. I am using ES6 Mocha Snippets

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

      @@sdetunicorns Thank you for the speedy response! I owe you a coffee!

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

    Hello Dilpreet Johal. I find your video very description as I am a new to Webdriverio. Please how do I handle 'cookies' message on website. You need to do aa video on it as there are little info of this on the web

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

      Hi, I am glad you are liking the videos. Typically, "cookies" message on website are just like other web elements that you can accept/cancel by clicking on a button. Once you identify what kind of web element it is, you should be able to handle that accordingly.

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

    Are you familiar with mocha-steps for test case dependencies? Can you please make a short video on it? I searched entire you-tube, no content related to it.

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

      I have used it in the past, however, try to not use mocha-steps as your tests become dependent on each other. You should focus on your tests keeping as isolated as possible so that you can take advantage of parallelization.

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

      @@sdetunicorns hmm.. satisfied but it has to be used. Do you have any link which can be followed for implementing mocha-steps!

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

      If you need to have dependent tests, I'd use the suites in WebdriverIO to specify which files should run first - webdriver.io/docs/organizingsuites.html

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

    can you open your tests in a chrome with a profile?

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

    First of all, thank you very much for the tutorial! I have one issue. When I use function respond on ts, the error 'Property 'respond' does not exist on type 'Mock'.ts' is occur. How can I fix it?

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

    can you please make short video on selectors

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

      Yes I'm planning to do one some time soon

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

    Hi, the second test case is failling for me "SearchInput.setValue is not a function" all other test cases are passing. How to fix this?

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

      You can compare your code here to make sure you have entered all the details correctly - github.com/automationbro/webdriverio-tutorial

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

      @@sdetunicorns I see, it was addValue instead of setValue but still gives me same TypeError message using WebDriverIO version 7.

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

      hi i am also facing the same issue....please help

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

      @@vinayfrommexico7350 problem is in the package.json Adding @wdio/sync dependency fixed it for me.

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

      @@swatOP ok buddy will try it... Thanks

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

    i have all tests passed even when they should not be passed. Do you know something about this problem?

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

      Yes, that's because you need to use async-await for latest WebdriverIO versions to handle promises. I have covered that in detail in my course here - www.udemy.com/course/webdriverio-complete-beginner-course/?couponCode=AUG-WDIO-SALE-19

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

    Hi! I have an issue. When I run the test, the driver doesn't open the web page.Could you help me?

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

      what error does it give you?

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

      @@sdetunicorns Oh, sorry for interrupted you. The web page has been opening.

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

    I am getting SearchInput.addValue is not a function error while execuing the 2nd test case.. Its not detecting any object i belive.. I am able to open the browser and URL.

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

      Hi, that's due to some of the latest changes that happened with WebdriverIO sync mode. I created a video recently to talk about this exact issue - ua-cam.com/video/Jk6giesyECA/v-deo.html
      Essentially, you will need to install the @wdio/sync package to follow along with the videos. You can find out more about it in the video I mentioned.

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

    Why would I pick this over Cypress?

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

      There are many advantages to go with WebdriverIO such as cross-browser compatibility, support for both Web and Mobile, can be paired with multiple testing frameworks or assertion libraries (mocha, jasmine, cucumber), some small things such as working with multiple tabs/browser windows at the same time.
      That being said, depending on what your requirement is you can compare both and decide what works best in your case.

  • @indhunataraj6473
    @indhunataraj6473 4 роки тому

    Hi ,
    In the application I work, I have to click and pick a slot from a calendar(Which is a Plugin). I have tried to click a slot using Xpath which worked fine when I tried the same thing in Java Selenium using actions class, However am not able to do the click here in Webdriver IO, I used the waits, click method, move to, Nothing worked.
    Getting an "Element Intercepted exception, Other elements would receive the click".
    When I read click method in web driver IO docs, they asked to handle this using "execute" command, however, I don't know how to do it. Can you help me with some inputs pls?

    • @sdetunicorns
      @sdetunicorns  4 роки тому

      Hi, this typically happens when there's another item overlaying your element. Try to see if you can find that element and remove it via execute command. I've shown how to use execute command in this video - ua-cam.com/video/2hcfNWobjdM/v-deo.html. You can skip to 6:45 to see how I am using 'execute' command to show a hidden element which was not intractable. You can use it similar way to remove an overlaying element and then try to click your main element.

    • @indhunataraj6473
      @indhunataraj6473 4 роки тому

      @@sdetunicorns Okay Thanks, I will look into the video and try if it works in my case. I will get back to you if I get stuck anywhere.

    • @indhunataraj6473
      @indhunataraj6473 4 роки тому

      Hi,
      I have tried to find the overlaying element and removed it using the below code
      browser.execute(
      function (value) {
      return document.querySelector('.fc-slot36 td div').remove();
      }, undefined
      );
      But still, no luck, getting the same exception. Don't know where it's going wrong.

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

    so we can test web & app & ios ?

  • @cruzdense
    @cruzdense 4 роки тому

    I don't see any id just a class, what should I do?

    • @sdetunicorns
      @sdetunicorns  4 роки тому

      You can use class to access it then by doing '.classname'

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

    Hi, I tried this code and I'm getting this error. can you pleas help TypeError: searchInput.setValue is not a function

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

      did you add parentheses after setValue ? searchInput.setValue()

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

      @@sdetunicorns searchInput.setValue('mouton'); this is what I have used

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

      @@sdetunicorns Hi, installing the sync package fixed the issue. Thanks for the support

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

      Yes, they have made some changes which requires to install the sync package now. Glad you figured it out

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

    hi dilpreet i need your help

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

    plz help me