com.epam.jdi.uitests.web.selenium.elements.base.JdiStatic Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jdi-uitest-web Show documentation
Show all versions of jdi-uitest-web Show documentation
Epam UI Automation framework package for Web
package com.epam.jdi.uitests.web.selenium.elements.base;
import com.epam.jdi.uitests.web.settings.WebSettings;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import static com.epam.commons.LinqUtils.first;
/**
* Created by Roman_Iovlev on 2/21/2017.
*/
public class JdiStatic {
public static J $(WebElement webElement) {
return new J(webElement);
}
public static J $(String cssSelector) {
return new J(By.cssSelector(cssSelector));
}
public static J $(By locator) {
return new J(locator);
}
public static List $$(Collection extends WebElement> elements) {
List r = new ArrayList<>();
for(WebElement el : elements)
r.add($(el));
return r;
}
public static List $$(String cssSelector) {
return $$(By.cssSelector(cssSelector));
}
public static List $$(By locator) {
return $$(WebSettings.getDriver().findElements(locator));
}
public static J find(List jList, String value) {
return first(jList, e -> e.getText().equals(value));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy