Software Quality Assurance & Testing Asked by Sinu Reddy on January 27, 2021
I am trying to select the drop-down value inside my shadow element using the below code, I went to the last point but the selection has not happened.
I want to select any dropdown item from the screen based on text (trip.com, priceline.com, etc), please help.
WebElement shadowRoot1 = expandRootElement(root1);
WebElement root2 = shadowRoot1.findElement(By.id("hotels-search"));
WebElement shadowRoot2 = expandRootElement(root2);
WebElement root3 = shadowRoot2.findElement(By.id("detail"));
WebElement shadowRoot3 = expandRootElement(root3);
WebElement root4 = shadowRoot3.findElement(By.id("rates"));
WebElement shadowRoot4 = expandRootElement(root4);
WebElement root5 = shadowRoot4.findElement(By.tagName("hotel-rates-sort-bar"));
WebElement shadowRoot5 = expandRootElement(root5);
WebElement element = shadowRoot5.findElement(By.cssSelector("#__providersDropdown > div.dropdown > div"));
Select select= new Select(element);
select.selectByIndex(2);
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP