Switch to a specific window out of 100 windows and validate it in

Поділитися
Вставка
  • Опубліковано 8 вер 2024
  • In this video, I have covered one interview question:
    Switch to specific window out of 100 windows and validate it in #Selenium.
    ~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
    www.youtube.co...
    Follow me on my Facebook Page:
    / naveenqtpexpert
    Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:
    t.me/joinchat/...
    Naveen AutomationLabs Paid Courses:
    Java & Selenium:
    naveenautomatio...
    Java & API +POSTMAN + RestAssured + HttpClient:
    naveenautomatio...

КОМЕНТАРІ • 98

  • @jyotimukherjee4347
    @jyotimukherjee4347 2 роки тому +4

    Hello Naveen Sir. Thank you from bottom of my heart🙏🙏🙏 for making such useful contents in ur channel through which we gained so much knowledge. Because of urs video in Java, selenium, api and all I got placed in one of the renowned company in UK as software tester after a 5 years of career gap. I was a manual tester in my previous company but learning thru urs video I got so much confidence in automation that helps me alot to face the interviews in automation profile. You are doing great sir...thank you once again sir🙏🙏🙏 . You are true gem🤩🤩. Hopefully you read this msg🙂

  • @kadalivaraprasad450
    @kadalivaraprasad450 2 роки тому +6

    No one will beat you on the Selenium concepts explanation

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

    something out of box question and you swiftly handle it Naveen. I say its incredible

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

    Hi Naveen, The question here is switching to a specific window, lets say out of 100 windows i need to switch to the 25th window then instead of switching to all windows and getting the title, u should be able to switch to the 25th window directly with one line of code based on the index of the list, the code should somewhat look like this
    Set windowhandles = driver.getwindowhandles();
    ArrayList windows = new ArrayList (windowhandles);
    driver.switchTo().window(windows.get(i));
    where i is the index of the window to be switched;

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

    Thank you so much, your videos are really helpfull !
    When I feel automation challenging, I just watch your videos and it gives me solution.
    Thank you !

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

    Wonderfull Explanation..but only thing is no need to use list if we can do the same with set as well. 🙏

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

    @Naveen : Thank you so much for helping us.

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

      @Naveen, yesterday I had interview with L&T and he asked me that if the chrome version is keep on changing every week then how would you handle this? We are not supposed to do any manual intervention in this case.. Could you please help us with this question as well?

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

    Well explained and good to create generic functions as you have explained to easily move between and title is a good assertion point!! Keep up the good work!!

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

    superb superb sir

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

    Thank you for the clear explanations.....it helps a lot

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

    Very good explanation, Thanks Naveen!!

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

    One of the finest video and solution

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

    It's really helpful video naveen, but this question asked for fresher or experince person, pls mention that thing, for other helpful for

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

    Thankyou so much!Sir...very good explanation 👏

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

    @naveen you are a messiah for QAs

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

    Thank you for the video. However could you also make a video on how to use this SwitchToRightWindow as a reusable method in a different Java Class as it is not feasible to write such huge block every time.

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

    Hi Naveen, You are videos help us a lot. I have a little different question. We use MQs in between the webserver and app servers to log the communications. We use SSH client to fetch these logs and validate them. How can we automate this, because the logs are live and keep coming?

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

    Thanks Naveen. Could you also please make a video on the same origin policy. I was asked in the recent interview.

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

    Nice Explanation 👏👏 Good Work👍

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

    Your explanation is perfect

  • @AliG-se4ph
    @AliG-se4ph 2 роки тому +1

    great explanation

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

    Thank u so much Naveen 👍

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

    This guy is Amazing ❤️

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

    thanks, this was awesome code wrt window handles.

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

    Thank you so much Naveen :)

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

    Good explanation naveen

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

    Hi Naveen, I have a question regarding scroll into view. May I know, how can we implement the scripts to identify the specific web element without using scroll into view with some action. that means I need to set up the window page size such as chrome zoom % then we won't need to scroll down then click due to by default it is using 100% zoom & it doesn't matter whatever I have set up my chrome zoom % in current setting instead of the window size (dimension setup).

  • @AmitSingh-tk1il
    @AmitSingh-tk1il 2 роки тому

    Awesome sir 👏

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

    Thank you Naveen 👍

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

    I'm gonna try this with streams.

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

    Hi Naveen, I got interview qstn for you. "how to switch from one window pop to another window popup in selenium"

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

    I have one doubt. why we have converted that set into list? we can itrate in the set too right?

  • @alim241081
    @alim241081 Місяць тому

    i have a question why we are using list here,same thing we can achive by set also

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

    Why did we have to convert set into arrayList, is it because set doesnt maintain any order, however we would be still able to iterate a set. So why we are converting?

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

    sir i have mailed you one question please make a short video on that

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

    is it possible to run test cases daily on specific time without human intervention. Let me know how?

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

      Using Jenkins it is possible..

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

      @@manjugajre2939 How? kindly share any reference link

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

      Windows schedular ?

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

      @tushar, there are multiple ways to schedule your automated tests
      1) You can create a batch file and place that in the windows task scheduler
      2) You can create Jenkins pipeline and set the trigger
      3) You can create pipelines on Azure/AWS and schedule the trigger

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

    why set to list conversion??

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

    there is no need for List until you want to get the index by using normal for loop

  • @user-dr9iw3px4f
    @user-dr9iw3px4f Рік тому

    Thanks

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

    why was List created and Set contents put into it? pls can anyone answer?

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

    Write a program to convert number into digit and print in descending order and highest value.Can you please help me on this

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

    Hey Naveen, how we can close window without confirmation alert ? Please ans me expecting ans from you
    Thank you

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

    Hi Naveen
    I want to open a multiple windows and by closing all the windows I want to switch on parent window.
    Also want to get the title of all the window.
    Could you please help me to resolve this

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

    Hi, please guide me on the below query.
    Im an automation engineer (3.5+ Selenium + java, C# + Jenkins).
    For my career growth should i continue as Automation developer or move to DevOps? If yes then what could be the ideal experience to switch into DevOps?
    Will staying in Automation will be as same as DevOps in terms of profitability?
    Thank-you in Advance 😊

  • @dsahith5412
    @dsahith5412 9 місяців тому

    Hi Naveen,Is this applicable if we run our code in headless mode?

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

    HI Naveen while switching to next window in IE browser, am getting "NoSuchWindowException : unable to get browser " could you please help me out in this

  • @RohitChhavi
    @RohitChhavi 7 місяців тому

    These xpath is not working for me could you please help

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

    If i want to go to last opened window(Without using index),can some one please help

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

    Hey naveen trying to contact you, however not able to....
    Need your paid videos oly for devops part... please reply

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

    Hi Naveen i have interview questions like if we have open 4 windows and but want to close 3rd window I'm any window from four of them so this code can we make work for it

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

      You can provide some identification to 3rd window and switch to that window by using driver.switchto().window(3rdwindowidentification);
      And then use driver.close();

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

    If someone wants homework then he can go ahead and print what was the index of the opened tab. For eg. What was the index of the facebook tab out of all opened tabs

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

      Yes maintain the counter and keep increasing it. Once Facebook is found. Print the counter.

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

    sir i have a question about this chapter that i got an error invaliderror the same code why? and how should i do? plz check and give the teaching

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

      Sir how would anyone would be able to understand what error you’re getting …. Insufficient info

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

    Excellent. But after taking set why we are taking array list

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

      Because set are unordered in nature.

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

      Whatever the order, we are comparing again with window title before switch. Why convert to list?

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

      You can use set no issues

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

      Yes, can not we direct use of list instead of set?

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

      @@vinayp959 let us try

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

    Here, you are switching to all the open tabs and compare the title in rightwindow method, that means execution time will effect we really have 100 or more than windows. Can not we switch to required window without compare the title? Using index also may not work if open window order change. How can we achieve in this scenario?

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

      This is what I mentioned at the end. Please watch it once again.

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

      @@naveenautomationlabs yes, can you do a video with steams as well. I don't have much knowledge on java streams.

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

    Hi Sir,i did not understand why did you convert set to list,Please can yiu explain that!

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

      Just to convert it to order based collection

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

      @@naveenautomationlabs my dear sister learn java first , in english u should learn abcd like that

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

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

    Is there any chance for two pages have same title, if same how we will achieve switch to window required
    @Naveen

  • @-zokzok-9455
    @-zokzok-9455 2 роки тому

    if we have 100 pages open or more and we are gonna be switching one by one checking title we are gonna do that until next morning.

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

      No one is gonna use 100 windows tbh .. If you do you will find solutions

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

    Suppose there is 10 tabs open in window , now i have open a new tab. How can we identify recent open tab .

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

      You have to first store 10 tabs handles in Set initialTabs =driver.getWindowHandles();
      Then again use same
      Set PostTabs =driver.getWindowHandles();
      Now you can easily identify newly opened tab by differentiating initialTabls & PostTabs

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

    Set does not maintain the insertion order?

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

      Set will not maintain the insertion order, the elements are store based on hashcode values... However its impl class Linked HashSet maintains the insertion order.

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

    How to switch to correct Alert if there are 6 Alert pop up

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

      How can you get 6 alert pop ups at the same time?

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

      @@naveenautomationlabs this question is asked to me during interview how you can handle 6 pop up at same time?

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

    how can take screenshot of ua code bro