Hey Renu, you can use Actions class provided by Selenium, to select multiple options from a dropdown. Actions class interact with keyboard and mouse activities and you can select multiple option by pressing Ctrl and click on options. Checkout the following lines of code to understand better:
public class MultiSelectDropdown {
WebDriver driver;
@Test
public void testApp() {
System.setProperty("webdriver.chrome.driver", "D:\SeleniumDrivers\chromedriver.exe");
driver = new ChromeDriver();
driver.get("https://www.example.com/tags/tryit.asp?filename=tryhtml_select_multiple");
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
WebElement select1 = driver.findElement(By.xpath("//option[@value='Volvo']"));
WebElement select2 = driver.findElement(By.xpath("//option[@value='Saab']"));
Actions action = new Actions(driver);
action.keyDown(Keys.CONTROL).click(select1).click(select2).build().perform();
}
}