update fo test cases. and some code refactoring

find('children') will throw when node was not found