This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
1
Great Way to handle frames that have no names or ids.
Post Body
This is using selenium with capybara for test automation and these help greatly if the devs did not supply names or ids on the frames.
This method is used to interact with elements inside the the specified frame located by some dom property
def within_open_frame(dom_property,dom_value)
page.driver.browser.switch_to.frame(get_frame_index_by_dom_property(dom_property,dom_value))
yield
page.driver.browser.switch_to.default_content
end
This method returns the specified frames index by any dom property.
def get_frame_index_by_dom_property(dom_property,dom_value)
frame_array = page.all('iframe')
obj = frame_array.select { |frame| frame[dom_property.to_sym] =~ /#{Regexp.escape(dom_value)}/}.first
frame_array.index(obj)
end
Author
Account Strength
90%
Account Age
10 years
Verified Email
Yes
Verified Flair
No
Total Karma
4
Link Karma
1
Comment Karma
3
Profile updated: 1 day ago
Posts updated: 1 month ago
Subreddit
Post Details
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 10 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/ruby/commen...