微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

pywinauto print_control_identifier显示该元素,但无法通过ElementNotFoundError获取它

如何解决pywinauto print_control_identifier显示该元素,但无法通过ElementNotFoundError获取它

我试图使用child_window()函数在父节点下获取元素,但未找到错误。 这是父项的print_control_identifier()输出

db.getCollection('urls').aggregate([
    {
        // creating a nested array with keys and values
        // of the payload subdocument.
        // all other fields of the original document
        // are removed and only the filed arrayofkeyvalue persists
        "$project": {
            "arrayofkeyvalue": {
                "$objectToArray": "$$ROOT.payload"
            }
        }
    },{
        "$project": {
            // extract only the keys of the array
            "urlKeys": "$arrayofkeyvalue.k"
        }
    },{
        // merge all documents
        "$group": {
            // _id is mandatory and can be set
            // in our case to any value
            "_id": 1,// create one big (unfortunately double
            // nested) array with the keys
            "urls": {
                "$push": "$urlKeys"
            }
        }
    },{
        // "explode" the array and create
        // one document for each entry
        "$unwind": "$urls"
    },{
        // "explode" again as the arry
        // is nested twice ...
        "$unwind": "$urls"
    },{
        // Now "query" the documents
        // with your regex
        "$match": {
            "urls": {
                "$regex": /url_/
            }
        }
    },{
      // finally count the number of
      // matched documents
        "$count": "count"
    }
])

我运行了以下代码,尝试在编辑控件中更改文本并出现错误

>>> txb_custom.print_control_identifiers()
Control Identifiers:

Custom - ''    (L997,T127,R1075,B177)
['PET WBCustom','Custom']
child_window(auto_id="textBox",control_type="Custom")
   | 
   | Edit - 'PET WB'    (L997,B177)
   | ['Edit','PET Wbedit']
   | child_window(title="PET WB",auto_id="textBox",control_type="Edit")
   |    | 
   |    | ScrollBar - ''    (L0,T0,R0,B0)
   |    | ['ScrollBar','ScrollBar0','ScrollBar1']
   |    | child_window(auto_id="VerticalScrollBar",control_type="ScrollBar")
   |    | 
   |    | ScrollBar - ''    (L0,B0)
   |    | ['ScrollBar2']
   |    | child_window(auto_id="HorizontalScrollBar",control_type="ScrollBar")
   | 
   | Static - 'PET WB'    (L997,T150,B177)
   | ['Static','PET WB','PET WBStatic']
   | child_window(title="PET WB",auto_id="textBlock",control_type="Text")

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。