L
Lisa Cook
I'm working on a test script using Watir. I'm new to Ruby and I'm
struggling with syntax.
if (ARGV[0] == nil)
#caseName = 'Default'
caseName = 'Other'
else
caseName = ARGV[0]
end
root = doc.root
testCasePath = "*TestCases/TestCase[@name='" + caseName + "']"
REXML::XPath.each(doc.root, testCasePath) do |elt|
if (elt.attributes["name"] == caseName)
FirstName =elt.elements["FirstName"].text
puts FirstName
When I get the FirstName value there are a bunch of escape characters
(/n/t/t) coming from the XML document.
Do I have bad syntax or is there another problem?
Thanks.
struggling with syntax.
if (ARGV[0] == nil)
#caseName = 'Default'
caseName = 'Other'
else
caseName = ARGV[0]
end
root = doc.root
testCasePath = "*TestCases/TestCase[@name='" + caseName + "']"
REXML::XPath.each(doc.root, testCasePath) do |elt|
if (elt.attributes["name"] == caseName)
FirstName =elt.elements["FirstName"].text
puts FirstName
When I get the FirstName value there are a bunch of escape characters
(/n/t/t) coming from the XML document.
Do I have bad syntax or is there another problem?
Thanks.