sap 子元素个数

def test(session):
    door(session)
    tabs = session.findById("/app/con[0]/ses[0]/wnd[0]/usr/tabsTABSPR1")
    a = tabs.FindById(r'/app/con[0]/ses[0]/wnd[0]/usr/tabsTABSPR1')
    for i in range(a.Children.count):
        tmp = a.Children.Item(i)
        try:

            print('text', tmp.Text)
        except:
            pass
        try:
            print('children count', tmp.Children.count)
        except:
            pass
        print('------------------')

  

posted @ 2023-08-25 09:25  CrossPython  阅读(7)  评论(0编辑  收藏  举报