Selenium 4 Beginner Tutorial 10 | How to handle DropDown
Automation Step by Step
@raghavpalAbout
Simple Basic Beginners Step-by-Step tutorials ❤️ I create videos on Automation, Testing, DevOps, CI and related tools, technologies and platform Raghav is a teacher and founder of AutomationStepByStep.com He was an Automation Architect and has led multiple teams of Automation and DevOps Engineers. For over a decade, Raghav witnessed, worked, and delivered multiple Automation Testing Projects and worked with some awesome people in this industry ► https://automationstepbystep.com/ Some topics covered: - Jenkins - JMeter - Selenium - Appium - Cypress - Playwright - Katalon Studio - API Testing - Postman - Docker - Kubernetes - Other DevOps topics Words from Raghav We often need someone to hold our hand and help us take the first few steps before we learn to walk and run. I am on a mission to spread education and make it available to anyone willing to learn Never Stop Learning Raghav All education here is FREE FOR ALL, FOREVER Share with as many people as you can in your lifetime
Video Description
All FREE courses - https://automationstepbystep.com/ 00:00 Introduction 00:36 How to select an option from drop-down 08:18 How to store dropdown options in a list 14:48 How to deselect an option from drop-down How to select an option from Dropdown Step 1 - Import select class from selenium import org.openqa.selenium.support.ui.Select; Step 2 - Create a select object by referring to the select element WebElement selectElement = driver.findElement(By.id("option")); Select selectObject = new Select(selectElement); Step 3 - select object will give you multiple commands to select selectObject.selectByIndex(1); selectObject.selectByValue("option 2"); selectObject.selectByVisibleText("Option 3"); How to store dropdown options in a list Step 1 - Import select class from selenium import org.openqa.selenium.support.ui.Select; Step 2 - Create a list of type WebElement for the dropdown List<WebElement> allAvailableOptions = selectObject.getOptions(); OR List<WebElement> options = driver.findElements(By.id("option")); Step 3 - Create a LOOP to access all options for(WebElement option : options) { System.out.println(option.getText()); } How to deselect an option from Dropdown selectObject.deselectByIndex(1); selectObject.deselectByValue("option 2"); selectObject.deselectByVisibleText("Option 3"); #seleniumbeginnertutorials Stories by Raghav - https://automationstepbystep.com/stories/ My Udemy Courses - https://automationstepbystep.com/udemy-discounts/ Every LIKE & SUBSCRIPTION gives me great motivation to keep working for you You can support my mission for education by sharing this knowledge and helping as many people as you can If my work has helped you, consider helping any animal near you, in any way you can Never Stop Learning Raghav
Essential Stove Crafting Kit
AI-recommended products based on this video

Cmokifuly GMK67 65% Mechanical Keyboard Kit Tri-Mode South-Facing RGB LED for 3/5pin Switches,66 Keys+1 Knob Hotswap Socket PCB Gasket Mounted Plate Gaming DIY Keyboard Kit (White)

1/2 Piece Camping Stove, Compact Stove 23.5x13x25cm, Travel Friendly Propane Stove | Lightweight Outdoor Propane Kitchen Equipment, Portable Cassette Stove for Hiking

Ultra-Slim Bidet Attachment, Posterior&Feminine Wash-(Retractable Dual Nozzles), Non-Electric Bidet Attachment for Toilet Seat, Adjustable Fresh Cold Water Pressure, Stainless Steel Inlet (White)

Multi-Functional Vegetable Peeler for Kitchen,Vegetable Peeler Wooden Handle,2-in-1 Stainless Steel Fruit & Vegetable Peelers with Bottle Opener for Potato Pineapple (2PC)

Ultra-Slim Bidet Attachment, Posterior&Feminine Wash-(Retractable Dual Nozzles), Non-Electric Bidet Attachment for Toilet Seat, Adjustable Fresh Cold Water Pressure, Stainless Steel Inlet (White)

Custom Graduation Tumbler Gifts for Him Her, Personalized Skinny Tumbler with Lid and Straws, Class of 2026 Gifts for Women Men, Graduation Cups Gift for Son Daughter, 20 oz Stainless Steel Tumbler

The Book. The Ultimate Guide to Rebuilding a Civilization - Inspirational Science Books for Adults - Unique Artifact - Knowledge Encyclopedia with Over 400 Pages of Detailed & Catchy Illustrations




















