1 package vid.automation.test.infra;
3 import org.apache.commons.io.FilenameUtils;
4 import org.apache.commons.lang3.SystemUtils;
5 import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
6 import org.openqa.selenium.WebElement;
9 * Created by itzikliderman on 11/09/2017.
12 public static void text(String text, String inputTestsId) {
13 WebElement inputElement = GeneralUIUtils.getWebElementByTestID(inputTestsId, 30);
14 inputElement.sendKeys(text);
17 public static String getValueByTestId(String testId) {
18 WebElement input = GeneralUIUtils.getInputElement(testId);
19 return input.getAttribute("value");
23 Get relative path to resource and id of file input element,
24 and send the resource full path to the input element
26 public static void file(String pathInResources, String inputId) {
28 String path = Input.class.getResource("../../../../"+pathInResources).getPath().toString();
29 if (SystemUtils.IS_OS_WINDOWS) {
30 path = FilenameUtils.separatorsToSystem(path);
31 if (path.charAt(0)=='\\') {
32 path = path.substring(1);
35 WebElement inputElement = Get.byId(inputId);
36 inputElement.sendKeys(path);