Is there sort of a hierarchy as far as "good automation test design"? Especially when it comes to finding elements.
Since sometimes "click_button" or "choose" (for radio buttons) just does not work (What usually causes this, by the way? Even when an ID/name is clearly shown in the HTML, it'll throw an element not found?)
Afterwards the next thing that I usually try is find. (Is this the wrong way to go about it?)
However with find you have many options, find by CSS, find by ID (if an ID exists) and then find by Xpath. Plus also finding by Elements (IE 'li' :text => "Whatever)
Is there a certain thing you should try before doing find (when an element is unable to be found the normal way, for whatever reason? I'm really curious what causes this)?
And when using find should you rely on Xpath last?...first? (I seem to always have to end up using Xpath w/Capybara+Poltergeist. But it feels brittle).
I'm just trying to figure out best practices for these things, is there a good guide for this?
Side question
find
vs page.find
or page.should have_content(text)
vs just should have_content(text)
? What's the difference? What does appending page.
exactly do?