com.automation.utils.ElementBy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of webdriver-helper-utils Show documentation
Show all versions of webdriver-helper-utils Show documentation
User can use webdriver with self managed mode. Just write test cases and use slandered method provided
for preforming ui operations. Debug mode for getting more detailed route cause analysis.
package com.automation.utils;
import org.openqa.selenium.By;
import org.openqa.selenium.SearchContext;
import org.openqa.selenium.WebElement;
import java.util.List;
public class ElementBy extends By {
@Override
public List findElements(SearchContext searchContext) {
return null;
}
public static By AttributeWithValue(String attribute, String value) {
return By.cssSelector("[" + attribute + "='" + value + "']");
}
public static By AttributeValueStartWith(String attribute, String value) {
return By.cssSelector("[" + attribute + "^='" + value + "']");
}
public static By AttributeContainsValue(String attribute, String value) {
return By.cssSelector("[" + attribute + "*='" + value + "']");
}
public static By Id(String id) {
return By.cssSelector("#" + id);
}
public static By elementWithText(String text) {
return elementWithText(text, 1);
}
public static By elementWithText(String text, int index) {
return By.xpath(".//*[text()='" + text + "'][" + index + "]");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy