6

I am writing tests to test the frontend of a store.

I create products and categories in the admin, this completes as one test.

I then complete a simple test to load the category on the frontend, this completes as one test.

I then try to sort the listing from high to low by price.

This is when the error happens, 'cannot find elements, "dropdowns" - "sort_by_price"

The XPath declared in the YAML is that given by FirePath (Firebug Extension), also the suggested Selenium Firefox Plugin path.

Any suggestions?

YAML

category_page_after_reindex:
mca: catalog/category/view/s/%categoryUrl%/id/%id%/
title: %elementTitle%
uimap: &catalogUIMap
    form: &categoryPage
        fieldsets:
          -
            dropdowns:
                sort_by_price: //div[@id='main']/div/div/div/div/div/select

FileTest.php

//Steps
$this->clickControl('dropdown', 'sort_by_price');
1
category_page:
    mca: %categoryUrl%.html
    title: %categoryTitle%
    uimap:
        form: &categoryPage
            fieldsets:
                -
                    category_view:
                        xpath: //div[@class='category-products']
                        dropdowns:
                            show_per_page: //div[@class='toolbar']//div[@class='limiter']/select
                            sort_by: //div[@class='toolbar']//div[@class='sorter']//select

source:

0

Sometimes you can change the xpath and see if it works. Though the xpath is correct, the webdriver cannot find the elements and you will have to try alternative xpath

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.