3

I am using Behat+Mink+Selenium2 to find an element using CSS selectors using tr.product:nth-of-type(N)

$row=$page->find('css',sprintf('tr.product:nth-of-type("%d")', $i));

I have also tried

$row=$page->find('css', sprintf('tr[class=product]:nth-of-type("%d")', $i));

but none of them work. Is there any other alternative to selecting every nth row with a class of product?

4

1 回答 1

1

我有同样的问题。好像和这个问题有关。我设法通过将我的浏览器从 Firefox 更改为 PhantomJS 来解决它。

behat.yml:

    extensions:
        Behat\MinkExtension\Extension:
            default_session: selenium2
            browser_name: phantomjs
于 2014-06-03T16:04:05.190 回答