Failed to instantiate page of type class using thucydides with htmlelements

1.1k Views Asked by At

I'm new here :). I'm writing own test framework now using thucydides v. 0.9.203 with htmelements v. 1.9 and chromedriver v. 2.30.0 and have troubles with compatibility between driver and thucydides. Please, find my pom.xml file bellow, where do I do a mistake?

 <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <thucydides.version>0.9.203</thucydides.version>
    <webdriver.chrome.driver>chrome</webdriver.chrome.driver>
    <maven.test.failure.ignore>true</maven.test.failure.ignore>
    <htmlelements.version>1.9</htmlelements.version>
    <testSourceDirectory>src/test/java</testSourceDirectory>
</properties>
<dependencies>
    <dependency>
        <groupId>net.thucydides</groupId>
        <artifactId>thucydides-core</artifactId>
        <version>${thucydides.version}</version>
    </dependency>
    <dependency>
        <groupId>net.thucydides</groupId>
        <artifactId>thucydides-junit</artifactId>
        <version>${thucydides.version}</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.7.21</version>
    </dependency>
    <dependency>
        <groupId>ru.yandex.qatools.htmlelements</groupId>
        <artifactId>htmlelements-matchers</artifactId>
        <version>${htmlelements.version}</version>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-chrome-driver</artifactId>
        <version>2.30.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-exec</artifactId>
        <version>1.3</version>
    </dependency>
    <dependency>
        <groupId>ru.yandex.qatools.properties</groupId>
        <artifactId>properties-loader</artifactId>
        <version>1.3</version>
    </dependency>
    <dependency>
        <groupId>ru.yandex.qatools.htmlelements</groupId>
        <artifactId>htmlelements-thucydides</artifactId>
        <version>1.11</version>
    </dependency>
    <dependency>
        <groupId>ru.yandex.qatools.htmlelements</groupId>
        <artifactId>htmlelements-java</artifactId>
        <version>${htmlelements.version}</version>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.19.1</version>
            <configuration>
                <systemPropertyVariables>
                    <webdriver.driver>chrome</webdriver.driver>
                </systemPropertyVariables>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.5.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>net.thucydides.maven.plugins</groupId>
            <artifactId>maven-thucydides-plugin</artifactId>
            <version>${thucydides.version}</version>
            <executions>
                <execution>
                    <id>thucydides-reports</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>aggregate</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Additionally, I have this Exception while running the tests:

Failed to instantiate page of type class com.epam.frameworks.thusydides.basics.pages.FilteringPage (null)

And there are FilteringPage and Steps code bellow:

public class FilteringPage extends PageObject {

    public FilteringPage(WebDriver driver) {
        super(driver);
    }

    public FilterBlock filterBlock;
}

public class FilterBlockSteps extends ScenarioSteps {

    public FilterBlockSteps(Pages pages){
        super(pages);
    }

    private FilteringPage onFilteringPage(){
        return pages().get(FilteringPage.class);
    }

    @Step("Ввод начальной цены {0}")
    public void setFilterStartPrice(String price) {
        onFilteringPage().filterBlock.priceFrom.sendKeys(price);
    }

    @Step("Ввод конечной цены {0}")
    public void setFilterFinishPrice(String price) {
        onFilteringPage().filterBlock.priceTo.sendKeys(price);
    }

    @StepGroup
    public void filtering(String priceFrom, String priceTo){
        setFilterStartPrice(priceFrom);
        setFilterFinishPrice(priceTo);
    }
}
0

There are 0 best solutions below