Web Application Testing in Ruby
This will help you for Automation Software Testing with Watir Tool(Ruby)
Labels
Watir testing
General Testing
ruby scripting
Watir Framework
Services
Training Institutes in India
Saturday, January 29, 2011
How Ruby XPath to find attribute ?
What Ruby library can be used to select attribute using XPath, and to use it as the starting point for other XPath queries.
Example:
Desired code:
get_pair "//*/@key", "../@value"
get_pair "//*/@foo", "../@bar"
Expected output:
"A" "B"
"C" "D"
"E" "F"
Pseudo implementation:
def get_pair(key, value)
xml_doc.select[key].each do |a|
puts [a, a.select[value]]
end
end
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment