1 package vid.automation.test.infra;
3 import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
4 import org.openqa.selenium.WebElement;
5 import org.openqa.selenium.support.ui.Select;
6 import vid.automation.test.Constants;
11 * Created by itzikliderman on 18/07/2017.
13 public class SelectOption {
14 public static Select byValue(String value, String dataTestsId) {
15 Select select = new Select(GeneralUIUtils.getWebElementByTestID(dataTestsId));
17 select.selectByValue(value);
23 public static void byIdAndVisibleText(String id, String text) {
24 Select selectlist = new Select(Get.byId(id));
25 selectlist.selectByVisibleText(text);
28 public static void byClassAndVisibleText(String className, String text) {
29 final List<WebElement> webElements = Get.byClass(className);
30 webElements.forEach(webElement -> {
31 final String id = webElement.getAttribute("id");
32 byIdAndVisibleText(id, text);
36 public static void byTestIdAndVisibleText(String displayName, String selectDataTestId) {
37 GeneralUIUtils.getSelectList(displayName, selectDataTestId);
40 public static void selectFirstTwoOptionsFromMultiselectById(String multiSelectId) throws InterruptedException {
41 Click.byId(multiSelectId);
43 Click.byClass(Constants.MULTI_SELECT_UNSELECTED_CLASS);
44 Click.byClass(Constants.MULTI_SELECT_UNSELECTED_CLASS);