org.sitoolkit.tester.domain.genscript.selenium.SeleniumPageLoader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sit-wt Show documentation
Show all versions of sit-wt Show documentation
SIToolkit for Web Testing
The newest version!
package org.sitoolkit.tester.domain.genscript.selenium;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import org.openqa.selenium.By;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.Point;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.sitoolkit.tester.domain.test.ElementPosition;
public abstract class SeleniumPageLoader {
@Resource
protected WebDriver driver;
protected ElementPosition convert(Point point) {
return new ElementPosition(point.x, point.y, 0, 0);
}
protected WebElement findLabelByForId(String forId) {
try {
return driver.findElement(
By.cssSelector("label[for='" + forId + "']"));
} catch (NoSuchElementException e) {
return null;
}
}
@PreDestroy
public void preDestroy() {
driver.quit();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy