How To Handle Multiple Tabs And Windows In Cypress | Cypress Tutorial

Поделиться
HTML-код
  • Опубликовано: 4 дек 2024
  • This video explains how to handle multiple tabs in Cypress and how to handle multiple windows in Cypress. We will see multiple real world examples of working with multiple tabs and windows in Cypress. It is also one of the popular cypress interview question. It helps with cypress interview preparation also as a part of cypress interview questions and answers.
    ******* Join LinkedIn Group *******
    / 14208166
    ******* Explore Indian Lifestyle in America *******
    Rohini's Channel: • My Favorite Shopping P...
    ******* Follow my non-work life *******
    Anil's Instagram: / aniltomar
    Rohini's Instagram: / its_rohini_tomar
    ****************************************************************
    Complete Test Automation Bundle ($29.99 Only):
    Includes 9 Courses, future new test and automation courses will be added to this bundle
    www.letskodeit...
    ****************************************************************
    Industry Standard Advanced Automation Framework ($8.99 Only)
    www.letskodeit...
    ****************************************************************
    Selenium WebDriver With Java ($8.99 Only):
    www.letskodeit...
    ****************************************************************
    Selenium WebDriver With Python ($8.99 Only):
    www.letskodeit...
    ****************************************************************
    API Test Automation Using RestAssured ($8.99 Only):
    www.letskodeit...
    ****************************************************************
    Web Automation Bundle ($19 Only):
    www.letskodeit...
    ****************************************************************
    Please be our Patron and support us to provide you great content:
    / letskodeit
    Website:
    www.letskodeit.com
    Join Private Facebook Group:
    / letskodeit
    #cypressio #interviewquestions #cypressiotutorial

Комментарии • 38

  • @zaidshaaban.
    @zaidshaaban. 8 месяцев назад +1

    Thanks , very helpful

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  8 месяцев назад +1

      Glad it helped you :)
      Please help spread the word by liking and sharing the video.

  • @akalyaannadurai4142
    @akalyaannadurai4142 9 месяцев назад +1

    Thanks lot for putting this video it's really helped me a lotttt❤

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  9 месяцев назад +1

      Glad it helped you :)
      Please help spread the word by liking and sharing the video.

  • @UCIUbaf3b8lN7Q5GA8qO
    @UCIUbaf3b8lN7Q5GA8qO Год назад +1

    The god of QA, thanks dude, you are awesome.

    • @UCIUbaf3b8lN7Q5GA8qO
      @UCIUbaf3b8lN7Q5GA8qO Год назад +1

      One thing is that when doing the second method with removing attr, when navigating to link (in the same tab), I can't do any interactions, the expected title is empty, I can't click I can't do anything.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  Год назад +1

      Glad it helped you :)
      Please help spread the word by liking and sharing the video.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  Год назад +2

      @@UCIUbaf3b8lN7Q5GA8qO You can send your code file at letskodeit@gmail.com, I will take a look.

    • @UCIUbaf3b8lN7Q5GA8qO
      @UCIUbaf3b8lN7Q5GA8qO Год назад +1

      @@LetsKodeItOfficial I sent you, thanks for giving a hand!

  • @Штаты-и5щ
    @Штаты-и5щ Год назад +1

    Very useful video! Thanks brother!

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  Год назад +1

      Glad it helped you :)
      Please help spread the word by liking and sharing the video.

  • @paramchaudhary2078
    @paramchaudhary2078 Год назад +1

    It's really helpful to handle multiple tabs and windows in Cypress. Thanks! 👍

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  Год назад +1

      Glad it helped you :)
      Please help spread the word by liking and sharing the video.

  • @robinr2336
    @robinr2336 Год назад +1

    Great workaround. Thanks!

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  Год назад +1

      Glad it helped you :)
      Please help spread the word by liking and sharing the video.

  • @NehaParvin-ht7br
    @NehaParvin-ht7br Год назад +2

    I have a scenario where a window prompts up as soon as I visit a URL. In new window I need to provide email then click on Next button and then it will ask for password. Can you please tell me how to handle this situation?

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  Год назад +1

      If your application involves a lot of new windows/tabs/s then Cypress is not an ideal framework. My suggestion would be to choose other automation frameworks.

  • @swasthikag3691
    @swasthikag3691 Год назад +3

    Hi,
    How to handle the tabs and windows if there is no href or target attributes.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  Год назад +2

      In that scenario, we need to use cy.window() and cy.stub() functions. I have an upcoming Cypress course, send an email at letskodeit@gmail.com if you are interested to enroll in that.

    • @EC_ISHWARYAS
      @EC_ISHWARYAS 7 месяцев назад

      Yeah same problem for me too!

  • @muhammadakif5951
    @muhammadakif5951 4 месяца назад +1

    Hey I need help. I am using Cypress. I have a button which when clicked opens up a new tab. But there is no target attribute nor there is any href attribute. So how can I handle that.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  4 месяца назад +1

      If there is a navigation to a new link then there would always be href, please check with your developers or if it is a public website you can share the details here.

  • @CodeInterviewGuru
    @CodeInterviewGuru 2 месяца назад +1

    Is it possible to get a popup on the same parent window when we have reacttokens in our URLs which can change randomly? Can you please clarify?

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 месяца назад +1

      Are you seeing any issue?
      Can you please provide details?

    • @CodeInterviewGuru
      @CodeInterviewGuru 2 месяца назад +1

      @@LetsKodeItOfficial how to get elements from the another popup window? If we add selectors for those elements it is saying elements not found. Still it is searching elements in the main home page, how to make cypress to search elements in the second popup window page?

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 месяца назад +1

      @@CodeInterviewGuru We need to first open the pop-up on the same page using one of the ways shows in the video, then finding the elements will look for elements in the window which is currently open.

  • @AdnanErlansyah-nx7xp
    @AdnanErlansyah-nx7xp Год назад +1

    How about when the button redirects to the new window or page and not at the same page again. how we can handle it, for example if we have the case the button or anchor has attribute target with the value of '_blank'

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  Год назад +1

      This is what is recommended in this video, that we can update the behavior to redirect to the same page to handle tabs and windows.
      Cypress is not great with widows/tabs/s. If your application uses a lot of these then Cypress is not a good choice of tool for the application.

  • @HanhNguyen-oi6tl
    @HanhNguyen-oi6tl Год назад +2

    as I see, your video-only guide to handle multiple Tab and doesn't have handle multiple window in cypress, right?

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  Год назад +1

      Tab and Window are the same thing from a browser perspective.

    • @NehaParvin-ht7br
      @NehaParvin-ht7br Год назад +1

      ​@@LetsKodeItOfficialI'm getting a windows prompt as soon as I visit the URL. Can you please help me to handle this situation. The window is same as we used to get while accessing the Microsoft account. Firstly provide the username then hit the next button and then provide the password.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  Год назад +2

      @@NehaParvin-ht7br If your application involves a lot of new windows/tabs/s then Cypress is not an ideal framework. My suggestion would be to choose other automation frameworks.

  • @Bell4Fun
    @Bell4Fun Год назад +1

    Automation is nothing but pain. In ass work can be done in minutes is done by automation in days that too after investing fortune

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  Год назад +1

      Looks like you didn't perform regression testing on multiple releases. Automation is very helpful in real world 👍

  • @VikasKumar-uk9sk
    @VikasKumar-uk9sk Год назад +1

    nice video

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  Год назад +1

      Glad it helped you :)
      Please help spread the word by liking and sharing the video.

  • @MithunajhaS
    @MithunajhaS 9 месяцев назад +1

    I need the same kind of functionality in login process. After entering email, an window pops up with dynamic url and they are listening on the window until the user completes the login process. I'm facing issue to track the popup. Please suggest me a solution ASAP.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  9 месяцев назад +1

      What is the issue with tracking? Please provide details.
      Solutions provided in the video were not helpful?