Get with xptah filter not work
Closed this issue · 4 comments
I create this Test Case:
Library DebugLibrary
Library Collections
Library NcclientLibrary
Library XML
Test Login
${config} = Create Dictionary host=192.168.110.22 port=830 username=netconf password=
hostkey_verify=False alias=qwerty
${conn} = Connect &{config}
Should Be True ${conn}
${resp} = Get qwerty xpath /ietf-netconf-server:netconf-server
${xml_str} = Element To String ${resp}
Log To Console ${xml_str}
but exit with RPCError: XML namespace with prefix "ietf-netconf-server" not defined.
I am not sure, I think this might be a similar issue ncclient/ncclient#166
I solved the problem by using "subtree" method, this is the example:
*** Variables ***
${filter} <netconf-server xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-server"></netconf-server>
*** Test Cases ***
${config} = Create Dictionary host=192.168.110.22 port=830 username=netconf password= hostkey_verify=False alias=qwerty
${conn} = Connect &{config}
Should Be True ${conn}
${resp} = Get qwerty subtree ${filter}
${xml_str} = Element To String ${resp}
Log To Console ${xml_str}
Awesome, good to hear