vkosuri / robotframework-ncclient

Robotframework library for NETCONF clients
https://vkosuri.github.io/robotframework-ncclient/
MIT License
10 stars 6 forks source link

Get with xptah filter not work #11

Closed molyland closed 5 years ago

molyland commented 5 years ago

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.

vkosuri commented 5 years ago

I am not sure, I think this might be a similar issue https://github.com/ncclient/ncclient/issues/166

vkosuri commented 5 years ago

@molyland any further updates?

molyland commented 5 years ago

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}

vkosuri commented 5 years ago

Awesome, good to hear