User:Gshah2/sandbox
Appearance
This is a user sandbox of Gshah2. You can use it for testing or practicing edits. This is not the sandbox where you should draft your assigned article for a dashboard.wikiedu.org course. To find the right sandbox for your assignment, visit your Dashboard course page and follow the Sandbox Draft link for your assigned article in the My Articles section. |
== Matchers ==
Capybara finds an element either using Domain-specific language or XPath/CSS Selectors. Partial matches can lead to unexpected results. Two or more matches can even result in a failure with an Ambiguous match error. The following are the matching strategies supported by Capybara: <ref>https://github.com/jnicklas/capybara#matching</ref>
- :one – raises an error when more than one match found
- :first – simply picks the first match – Don’t use this!
- :prefer_exact – finds all matching elements, but will return only an exact match discarding other matches
- :smart – depends on the value for Capybara.exact. If set to true, it will behave like :one. Otherwise, it will first search for exact matches. If multiple matches are found, an ambiguous exception is raised. If none are found, it will search for inexact matches and again raise an ambiguous exception when multiple inexact matches are found.