【RF库XML测试】Get Element

Name:
Get Element
Source:
XML <test library>
Arguments:
[ source | xpath=. ]
Returns an element in the `source` matching the `xpath`.
The `source` can be a path to an XML file, a string containing XML, or an already parsed XML element. The `xpath` specifies which element to find. See the `introduction` for more details about both the possible sources and the supported xpath syntax.
The keyword fails if more, or less, than one element matches the `xpath`. Use `Get Elements` if you want all matching elements to be returned.

Starting test: Test Rf Api.Testxml.Get Element
20170620 22:49:23.114 : INFO : ${second} = <Element 'second' at 0x033E9878>
20170620 22:49:23.114 : INFO : ${child} = <Element 'child' at 0x033E9920>
20170620 22:49:23.114 : INFO : {'id': '2'}
20170620 22:49:23.114 : INFO : 2
20170620 22:49:23.114 : INFO : None
20170620 22:49:23.114 : INFO :
Argument types are:
<type 'NoneType'>
<type 'NoneType'>
20170620 22:49:23.114 : INFO : ${third} = <Element 'third' at 0x033E9B60>
20170620 22:49:23.114 : INFO : {}
20170620 22:49:23.130 : INFO : ${b} = <Element 'b' at 0x033E9DA0>
20170620 22:49:23.130 : INFO : and
20170620 22:49:23.130 : INFO :
Argument types are:
<type 'str'>
<type 'unicode'>
20170620 22:49:23.130 : INFO : ${p} = <Element 'p' at 0x033E9E78>
20170620 22:49:23.130 : INFO :

Text with
20170620 22:49:23.130 : INFO :
Argument types are:
<type 'str'>
<type 'unicode'>
20170620 22:49:23.130 : INFO : ${elem} = <Element 'third' at 0x033E9A28>
20170620 22:49:23.130 : INFO : third
20170620 22:49:23.130 : INFO :
Argument types are:
<type 'str'>
<type 'unicode'>
Ending test: Test Rf Api.Testxml.Get Element

原文地址:https://www.cnblogs.com/apple2016/p/7056739.html