Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.openqa.selenium.WebElement;
- import org.openqa.selenium.support.FindBy;
- import org.primitive.exceptions.ConcstructTestObjectException;
- import org.primitive.testobjects.Page;
- import org.primitive.webdriverencapsulations.SingleWindow;
- public class SearchBar extends Page implements IPerformsSearch{
- @FindBy(id = "gbqfq")
- private WebElement searchInput;
- @FindBy(id = "gbqfb")
- private WebElement searchButton;
- //я намерянно хочу показать панель поиска как отдельный объект,
- //часть главной страницы google. такой объект знает о браузерном окне, на котором живет
- public SearchBar(SingleWindow browserWindow)
- throws ConcstructTestObjectException {
- super(browserWindow);
- loadPageObject();
- }
- @PageMethod
- public void performSearch(String searchString) {
- searchInput.sendKeys(searchString);
- searchButton.click();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement