All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pages.nopcommerce.SearchPage Maven / Gradle / Ivy

Go to download

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

There is a newer version: 1.1.1
Show newest version
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