How to handle Bootstrap DropDown in Selenium - Session - 19

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

КОМЕНТАРІ • 58

  • @krishnakrishna934
    @krishnakrishna934 4 роки тому +1

    Thank you so much Naveen i really cant express happiness ..i am just asked every person but i dont get answer like you from any1 ...Really this concept is very very useful..bcoz 80% of people dnt know how to do bcoz we always depend upon select class..

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

    Thank you very much Naveen to explain this topic in a smart and easy way. Keep it up Naveen😊

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

    Hi Naveen, videos which your posting is very helpful and am referring your video to practice and expertise automation....really helpful

  • @madhusudandevaraju1207
    @madhusudandevaraju1207 5 років тому +5

    For the already selected options, we can't use isSelected() method. Because this method always returns false. So we have to use the li-class which changes the class name to "active" when the checkbox is selected. So we can select all the checkboxes without unselecting the already selected ones by using below logic.
    for (int i = 0; i < bsOptions.size(); i++) {
    if ((bsOptions.get(i).getAttribute("class").equalsIgnoreCase("active"))) {
    System.out.println(bsOptions.get(i).getText());
    Thread.sleep(1000);
    } else
    bsOptions.get(i).click();
    }

    • @umangsharma7447
      @umangsharma7447 5 років тому

      awesome bro !

    • @umangsharma7447
      @umangsharma7447 5 років тому

      As mentioned by madhu : - we have to get the list of elements as below ( i.e. till the li class)
      List elements = driver.findElements(By.xpath("//ul[contains(@class,'multiselect')]//li"));
      for (WebElement ele : elements) {
      System.out.println(ele.getAttribute("class").equalsIgnoreCase("active"));
      if(ele.getAttribute("class").equalsIgnoreCase("active"))
      {
      System.out.println(ele.getText());
      }
      else {
      ele.click();
      }
      }

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

      Hello Sir, i was looking for a solution for this issue, thanks a lot for the comment

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

    Very nice explanation..which is in detail..i just subscribed your channel though its old its very useful now..

  • @Anaris13
    @Anaris13 4 роки тому +1

    Great Thanks Naveen, this video helped me a lot, I paid attention you always sharing solution for most tricky cases. Again Thanks a lot .

  • @bsrinivas165
    @bsrinivas165 7 років тому +1

    Awesome explanation👌👌... Thank you 💐💐

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

    You are a damn hero!

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

    nice lecture plz keep uploading

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

    💌 excellent video

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

    Thank you naveen. it helped and worked great!

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

    Nice tutorial. Please make another tutorial to handle angular js dropdown.

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

    @Navin_AutomationLabs thanks, but i have one diffrent scenario. that is dropdown within dropdown. i.e. main tap is 'Financial' then it has three dropdown menu, then that each have other 4 dropdown. how can it be handle

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

    Use this method for calendar. It work

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

    thanks ... can you also share me how to work in roboframe work /pycharm only-- i dont use java framework??if you have already uploaded pls share

  • @22Shoyab
    @22Shoyab 6 років тому +1

    Hi naveen can you tell me how to validate which options from. Dropdown are highlighted by default (bootstrap dropdown)

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

    Good

  • @rajeshchowdary1615
    @rajeshchowdary1615 5 років тому

    Hi, Naveen your videos are very good,
    in this video I've doubt i.e once I clicked on the dropdown button I got 14 options as you said. And I want to select Angular so here I can use
    Dynamic XPath right i.e selecting the checkbox based on Angular element na .. here I'll inspect the independent element angular and dependent element checkbox... using XPath as ....... //label[text()=' Angular']/../../..//input[@value='Angular']

  • @Julyanajs
    @Julyanajs 6 років тому

    thanks for share, this video was very useful!

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

    Hi Naveen.. What if we have select tag under the div tag. Its not working if I use select class over there. Can I use your method for bootstrap??

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

    hi sir am following your channel for my preparation it is excellent and i got so much from your channel...can u plz guide me is this info is enough for 3 yrs exp candidates where i wanted to try my job search on 3 yrs experience.. prevoiusly i wrked in non-it sector will u guide me i hope ...👍👍👍

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

    Hi @naveen, I have a doubt why cannot we directly do the click operation rather than getting all the webelements of the bootstrap drop down and adding the for loop to find the text and then click, I understand that in dynamic web table we need to do this but why it is needed here also

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

    Thanks sir

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

    Hi Naveen, How to automate the Material UI dropdown?

  • @vijaybahadur5755
    @vijaybahadur5755 6 років тому +1

    That was really helpful....
    Can you please make one tutorial is video for Jmeter 5.0 also...?
    Please because you have got awesome ability to explain.. I love ❤ the way you elaborate something.
    Thanks in advance.

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

    Hi Navin, Thank you for the Bootstrap dropdown. It helped, but i have a dropdown which scrolls down, and using your method i was only able to select visible items in the dropdown, it is not scrolling down to find an element, used javascript query to scrollTo view, but did not scroll, can you help with this?

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

    Bro can you tell me how can I select random value on such a drop down

  • @sridevireddy1371
    @sridevireddy1371 7 років тому +2

    Thanks a ton...

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

    Hi Naveen
    I have same scenario where bootstrap dropdown having only "div" than nothing else. i have inspected on dropdown but found only div-class so unable to select dropdown items
    Could you please tell me how to handle such kind of dropdowns having only div class

  • @syedatif837
    @syedatif837 7 років тому

    Hello Naveen- I have the same scenario where I need to select multiple options from the dropdrown but when I click on the dropdrown and try to find the xpath of the elements in the dropdown, it does not show the xpath of the elements. The ul tag for me is hidden and I got it after i pressed F12 in the UI. Its very difficult for me to capture the xpath of the dropdown elements as when i just come out of the dropdown list the ul gets hidden in html code

  • @pushpapacharya
    @pushpapacharya 6 років тому +3

    Can't I write //ul[contains(@class,'multiselect-container')]//li//a//label[contains(text(),'Angular')] directly to select the element and perform click operation instead getting list of label then selecting that element and performing click operation?

    • @edwindeepak6234
      @edwindeepak6234 5 років тому

      I also have the same doubt. Have you checked the xpath?

    • @bipinmnair007
      @bipinmnair007 5 років тому

      Yes you can use the same as well

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

      If you want directly to click You can use //label[contains(text(),'Angular')] , but if your requirement is to validate all elements is thart dropDown you need to follow as Naveen did in video and store elements in List.

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

    Hi Navin, Can we use the same logic for Span class as well ? Please reply

    • @vijaysadanand5287
      @vijaysadanand5287 4 роки тому +1

      @Raghavi Br I hope you have got the code for span class but below code worked for me where there is div and span tag included...
      driver.findElement(By.xpath("//div[contains(@class,'selected-dial-code')]")).click();

      List list = driver.findElements
      (By.xpath("//div[contains(@class,'flag-container')]//ul//li//span[contains(@class,'dial-code')]"));

      System.out.println(list.size());

      for (int i=0;i

  • @akulabhaskar3797
    @akulabhaskar3797 7 років тому +1

    Hello Naveen Can u share the link which u used

  • @thippeswamyss5202
    @thippeswamyss5202 5 років тому

    I am facing some issue in selecting value in bootstrap drop down , i cant even see the drop down values in HTML code . Please help me with this .

  • @shaiksameena7603
    @shaiksameena7603 6 років тому

    Could you please how to edit drop-down values

  • @utlavamsi6976
    @utlavamsi6976 6 років тому

    Hiii guy's anyone recently faced interview for 3+experience guys. Which type questions you have faced at the time of interview pls pls guy's send me... Useful for everyone

  • @TheNishi42
    @TheNishi42 6 років тому

    Thank you !!

  • @saikirantelapalli8785
    @saikirantelapalli8785 6 років тому

    Hello Naveen, what if i need to select multiple check boxes not all in the drop down and also its very difficult for me to capture the xpath of the dropdown elements as when i just come out of the dropdown list the ul gets hidden in html code

    • @smitanair5721
      @smitanair5721 6 років тому

      You can use the or || operator to select multiple values in the if condition.

  • @sabrinsabrin566
    @sabrinsabrin566 7 років тому +1

    How to write the code when select value which try to find out by index???

    • @syedatif837
      @syedatif837 7 років тому

      Select selectElement=new Select();
      selectElement.selectByValue("value" ); here value is attribute of the options tag

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

      You can past index as a argument to your method and while you are looping just do :--> if(i==arg){ List.get(i).click(); }

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

    😊🙏

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

    I use this customized xpath, List list = driver.findElements(By.xpath("//div[@class='dropdown show']//child::div"));
    System.out.println(list.size());
    for(int i=0; i

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

    you must need to show some different websites