我使用Behat與貂和硒2. 問題是,我有一個元素兩次...「設置」。 第一個元素是(例如)<a href="settings.php">Settings</a>
,第二個元素是不可見菜單<a href="settings.php">Settings</a>
中的快速鏈接。網站上的多個元素
如何在szenario中選擇第二個「Settings」元素?
當前的例子:
Feature: Setting links
Check the links
Scenario: I check the links for settings
Given I am logged in as "user":"name"
Given The page is loaded
# Now the problem... I have "Settings" twice and i would test both of them
When I follow "Settings"
And The page is loaded
Then The parameter "sid" should match "[0-9]*"
And I should see text matching "ID"
And I should see text matching "Firstname"
And I should see text matching "Surname"
And I should see text matching "Street"
And I should see text matching "Zip code"
And I should see text matching "Country"
預先感謝您的任何提示! :)
嗯,我會承擔一個是可見的,一個也不會,所以檢查元件上的'Displayed'財產。 – Arran
嗯,怎麼樣?我認爲你的意思是FeatureContext,對吧? – PatrickB
你的問題是如何編寫小黃瓜,如何使用硒,或兩者兼而有之? – Louis