• Wednesday , 1 April 2020

How to handle Bootstrap DropDown in Selenium – Session – 19

Code Canyon
https://i.ytimg.com/vi/Tm1TeqdYrrI/hqdefault.jpg



How to handle Bootstrap DropDown in Selenium :

• How to handle different styles of bootstrap down
• Click on the given dropdown
• Get all the tags while are available under “li” tag
• Get the text of each “li//a” OR “div//a”
• Match the text and click on it

===================================================
Please subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:

Channel URL:
https://www.youtube.com/c/Naveen%20AutomationLabs?sub_confirmation=1
=======================================================
Follow me on my Facebook Page:
https://www.facebook.com/groups/naveenqtpexpert/

Let’s join our Automation community for some amazing knowledge sharing and group discussion. Plz join via this link:

https://t.me/joinchat/COJqZQ4enmEt4JACKLNLUg

-~-~~-~~~-~~-~-
Follow my Site/Blog: http://www.naveenautomationlabs.com
========================================================
Please watch: “Selenium & Automation Interview Preparation – By Naveen AutomationLabs”

-~-~~-~~~-~~-~- Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
https://www.youtube.com/c/Naveen%20AutomationLabs?sub_confirmation=1

Follow me on my Facebook Page:
https://www.facebook.com/groups/naveenqtpexpert/

Let’s join our Automation community for some amazing knowledge sharing and group discussion on Telegram:
https://t.me/joinchat/COJqZUPB02r5sB73YMdXEw

Paid courses (Recorded) videos:
Java & Selenium Course: http://www.naveenautomationlabs.com/p/course-content-selenium-webdriver-is.html
API Course: http://www.naveenautomationlabs.com/p/syllabus-course-content-manual-testing.html ➡️Get Our Courses✔️
📗 Get My Paid Courses at
Paid courses (Recorded) videos:
Java & Selenium Course: http://www.naveenautomationlabs.com/p/course-content-selenium-webdriver-is.html
API Course: http://www.naveenautomationlabs.com/p/syllabus-course-content-manual-testing.html
——————————-

✔️SOCIAL NETWORKS
Facebook: https://www.facebook.com/groups/naveenqtpexpert/
Twitter: https://twitter.com/naveenkhunteta
Blog: http://www.naveenautomationlabs.com
——————————–

Support My Channel✔️Or Buy Me A Coffee
Paypal: https://paypal.me/naveenkhunteta
Google Pay: naveenanimation20@gmail.com
——————————–
✔️Thanks for watching!
देखने के लिए धन्यवाद
Благодаря за гледането
感谢您观看
Merci d’avoir regardé
Grazie per la visione
Gracias por ver
شكرا للمشاهدة

Original source

3d Ocean

Related Posts

20 Comments

  1. THIPPESWAMY SS
    February 26, 2020 at 17:27

    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 .

  2. Kavita Jadhav
    February 26, 2020 at 17:27

    Hello sir I am unable to find element from Select Role dropdown. plz help me
    url is
    https://ebiz.licindia.in/D2CPM/#Login

  3. Rajesh Chowdary
    February 26, 2020 at 17:27

    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']

  4. Madhusudan Devaraj
    February 26, 2020 at 17:27

    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();

    }

  5. pushpa acharya
    February 26, 2020 at 17:27

    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<webElement> of label then selecting that element and performing click operation?

  6. SHOYAB KHAN
    February 26, 2020 at 17:27

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

  7. Vijay Bahadur
    February 26, 2020 at 17:27

    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.

  8. dinesh dalai
    February 26, 2020 at 17:27

    How to login on spicejet using Selenium WebDriver.

  9. Utla Vamsi
    February 26, 2020 at 17:27

    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

  10. Romita Thakur
    February 26, 2020 at 17:27

    Thank you !!

  11. Juliana Souzza
    February 26, 2020 at 17:27

    thanks for share, this video was very useful!

  12. shaik sameena
    February 26, 2020 at 17:27

    Could you please how to edit drop-down values

  13. saikiran telapalli
    February 26, 2020 at 17:27

    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

  14. Syed Atif
    February 26, 2020 at 17:27

    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

  15. Mahendra Mungase
    February 26, 2020 at 17:27

    Hi Naveen,

    Hello Sir,

    Can you please assist me in Bootstrap –

    If Bootstrap dropdown has more than 15+ options and has an AutoScroll.

    How do I scroll Bootstrap in selenium?

    My mail id – mahendramungase@gmail.com

    Can you please share your mail id

    Thanks,
    Mahendra

  16. Sabrin Sabrin
    February 26, 2020 at 17:27

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

  17. Sridevi Reddy
    February 26, 2020 at 17:27

    Thanks a ton…

  18. B Srinivas
    February 26, 2020 at 17:27

    Awesome explanation👌👌… Thank you 💐💐

  19. Akula Bhaskar
    February 26, 2020 at 17:27

    Hello Naveen Can u share the link which u used

  20. kosmicspace
    February 26, 2020 at 17:27

    Hi Naveen, I tried your bootstrap drop down logic in the following URL
    https://www.makemytrip.com/international-flights/dubai-india-lufthansa_airlines-tickets.html
    to fetch all the cities "from" drop down.
    As you said I used the xpath as "//ul[2][@class='ui-autocomplete ui-menu ui-widget ui-widget-content ui-corner-all']//li//a" .
    Actual count is 84 cities but when I execute through webdriver it displays only
    28 cities.
    Please help me to solve this issue.

Leave A Comment

You must be logged in to post a comment.