
pages.nopcommerce.SearchPage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of AUTOTESTIMATIC-JAVA Show documentation
Show all versions of AUTOTESTIMATIC-JAVA Show documentation
An open-source Selenium Java-based Test automation Framework that allows you to perform multiple actions
to test a web application's functionality, behaviour, which provides easy to use syntax,
and easy to set up environment according to the needed requirements for testing
package pages.nopcommerce;
import driverfactory.webdriver.WebDriver;
import org.openqa.selenium.By;
public class SearchPage{
private final WebDriver driver;
By searchField = By.id("small-searchterms");
By searchButton = By.cssSelector("button.button-1.search-box-button");
By productResult = By.cssSelector("div.picture");
By productList = By.id("ui-id-1");
public SearchPage(WebDriver driver) {
this.driver = driver;
}
public SearchPage productSearch(String productName)
{
driver.element().fillField(searchField, productName);
driver.element().click(searchButton);
return this;
}
public ProductDetailsPage openProductPage() {
driver.element().click(productResult);
return new ProductDetailsPage(driver);
}
public ProductDetailsPage productSearchUsingAutoSuggest(String searchText)
{
driver.element().fillField(searchField, searchText);
driver.element().findElements(productList).get(0).click();
return new ProductDetailsPage(driver);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy