I have code that retrieves a static text element for me, but what I want to do is get the xpath of this element as a string. I use ruby. At this point, I have an array of elements that I have already extracted. Below I tried, but no luck.
elements.each do |element|
if element.attribute("name").include? vProblem
p "Problem found, retrieving xpath..."
p "Problem xpath is: " + element.attribute("xpath").to_s
p "Problem xpath is: " + element.xpath.to_s
end
end
source
share