0
xpathに従ってGUIでオブジェクトを検索する方法を探しています。アプリケーションの識別の一部 私は次のようなxpathを持っています:PyWinAuto - XpathのようなID
./pane [0]/pane [0]/pane [1]/pane [0]/pane [1]/pane [0]/pane [編集] [0]
これは(問題がなければ)アプリケーション要素ツリーで選択したEDITをポイントする必要があります。
私は今で書かれた再帰関数を持っていないが、多分私は間違った道を行くよ、この
#app is the application under test, this is working correctly
top = app.top_window()
first = top.child_window(control_type="Pane")
print first #here is first problem: This will find all the child_windows, no just the direct children, without depth search (is it possible to just search particular direct childrens, without deeper search?)
first = top.child_window(control_type="Pane", ctrl_index=0)
#this is much better
second = first.child_window(control_type="Pane", ctrl_index=0)
print second
#this is working, i'm looking for [0] indexed Pane under first found element
third = second.child_window(control_type="Pane", ctrl_index=1)
print third
# we have another problem , the algorithm is depth first, so ctrl_index=1 is not referencing to '2nd child of element named second', but instead to the first element of first pane, founded under 2nd element. (I'm looking for wide first algorithm)
などのアイテムを識別するために、このXPathを使用しようとしました。
ですから、問題は、スタイルのようなxpathで要素へのパスを回復する方法はありますか?それはそうなっているはずです最初のケースでは
おかげ
は助けた私の答えはありますか? –