weixin_55001863 2023-07-05 12:46 采纳率: 50%
浏览 91
已结题

python进入软件页面操作

如何进入操作窗口,将控件属性下面都发了,麻烦指点怎么进入最晚签收查询页面

img


这个是通过inspect查询的最晚签收查询菜单属性

How found:    Selected from tree...
Name:    "最晚签收查询"
ControlType:    UIA_MenuItemControlTypeId (0xC35B)
LocalizedControlType:    "菜单项目"
BoundingRectangle:    {l:93 t:623 r:318 b:673}
IsEnabled:    true
IsOffscreen:    false
IsKeyboardFocusable:    true
HasKeyboardFocus:    false
AccessKey:    ""
ProcessId:    9040
RuntimeId:    [2A.105EC.4.FFFFCD64]
FrameworkId:    "Chrome"
IsControlElement:    true
ProviderDescription:    "[pid:9040,providerId:0x0 Main(parent link):Microsoft: MSAA Proxy (IAccessible2) (unmanaged:UIAutomationCore.DLL)]"
AriaRole:    "menuitem"
AriaProperties:    ""
IsPassword:    false
IsRequiredForForm:    false
IsDataValidForForm:    true
HelpText:    ""
Culture:    9
PositionInSet:    1
SizeOfSet:    5
IsDialog:    false
LegacyIAccessible.ChildId:    0
LegacyIAccessible.DefaultAction:    "选中"
LegacyIAccessible.Description:    ""
LegacyIAccessible.Help:    ""
LegacyIAccessible.KeyboardShortcut:    ""
LegacyIAccessible.Name:    "最晚签收查询"
LegacyIAccessible.Role:    菜单项目 (0xC)
LegacyIAccessible.State:    可设定焦点 (0x100000)

Next:    "货量预报查询(老)" 菜单项目
Previous:    [null]
Other Props:    Object has no additional properties
Children:    Container has no children
Ancestors:    "" 菜单
    "" 菜单
    "" 菜单
    """""河南信阳息县" 文档
    "河南信阳息县" 窗格
    "桌面 1" 窗格
    [ No Parent ]

img

这个是通过inspect查询的最晚签收查询页面的属性,能否通过连接直接进入


```python
How found:    Focus
    hwnd=0x003406C4 64bit class="Chrome_RenderWidgetHostHWND" style=0x56300000 ex=0x20
Name:    "最晚签收查询 - KPI管理"
ControlType:    UIA_DocumentControlTypeId (0xC36E)
LocalizedControlType:    "文档"
BoundingRectangle:    {l:319 t:177 r:1409 b:967}
IsEnabled:    true
IsOffscreen:    false
IsKeyboardFocusable:    true
HasKeyboardFocus:    true
AccessKey:    ""
ProcessId:    9040
RuntimeId:    [2A.3406C4.4.FFFFDF04]
AutomationId:    "52016032"
FrameworkId:    "Chrome"
ClassName:    "Chrome_RenderWidgetHostHWND"
NativeWindowHandle:    0x3406C4
IsControlElement:    true
ProviderDescription:    "[pid:7420,providerId:0x3406C4 Main:Nested [pid:9040,providerId:0x3406C4 Annotation(parent link):Microsoft: Annotation Proxy (unmanaged:UIAutomationCore.DLL); Main:Microsoft: MSAA Proxy (IAccessible2) (unmanaged:UIAutomationCore.DLL)]; Hwnd(parent link):Microsoft: HWND Proxy (unmanaged:uiautomationcore.dll)]"
AriaProperties:    ""
IsPassword:    false
IsRequiredForForm:    false
IsDataValidForForm:    true
HelpText:    ""
Culture:    2052
IsDialog:    false
LegacyIAccessible.ChildId:    0
LegacyIAccessible.DefaultAction:    ""
LegacyIAccessible.Description:    ""
LegacyIAccessible.Help:    ""
LegacyIAccessible.KeyboardShortcut:    ""
LegacyIAccessible.Name:    "最晚签收查询 - KPI管理"
LegacyIAccessible.Role:    文档 (0xF)
LegacyIAccessible.State:    已设定焦点,只读,可设定焦点 (0x100044)
LegacyIAccessible.Value:    "https://max.ane56.com/kpi/manage/latestSignFor/query?isNoMenus=true&hideNoticeicon=true"
Scroll.HorizontallyScrollable:    false
Scroll.HorizontalScrollPercent:    0.000000
Scroll.HorizontalViewSize:    100.000000
Scroll.VerticallyScrollable:    false
Scroll.VerticalScrollPercent:    0.000000
Scroll.VerticalViewSize:    100.000000
Value.IsReadOnly:    true
Value.Value:    "https://max.ane56.com/kpi/manage/latestSignFor/query?isNoMenus=true&hideNoticeicon=true"

以下控件属性是通过print_control_identifiers()获取的属性

|    |    | MenuItem - '综合查询 '    (L93, T631, R318, B687)
   |    |    | ['MenuItem8', '综合查询 \uf0da', '综合查询 \uf0daMenuItem']
   |    |    | child_window(title="综合查询 ", control_type="MenuItem")
   |    |    |    | 
   |    |    |    | Static - '综合查询'    (L124, T646, R200, B672)
   |    |    |    | ['Static26', '综合查询', '综合查询Static']
   |    |    |    | child_window(title="综合查询", control_type="Text")
   |    |    |    | 
   |    |    |    | Static - ''    (L104, T651, R123, B670)
   |    |    |    | ['\uf0da8', 'Static27', '\uf0daStatic8']
   |    |    |    | child_window(title="", control_type="Text")
   |    |    | 
   |    |    | Menu - ''    (L93, T686, R318, B1202)
   |    |    | ['\uf0daMenu2', 'Menu2']
   |    |    | child_window(auto_id="rc-menu-uuid-84804-1-593130-popup", control_type="Menu")
   |    |    |    | 
   |    |    |    | MenuItem - '扫描查询 '    (L93, T686, R318, B741)
   |    |    |    | ['扫描查询 \uf0daMenuItem', '扫描查询 \uf0da', 'MenuItem9']
   |    |    |    | child_window(title="扫描查询 ", control_type="MenuItem")
   |    |    |    |    | 
   |    |    |    |    | Static - '扫描查询'    (L135, T701, R206, B725)
   |    |    |    |    | ['Static28', '扫描查询', '扫描查询Static']
   |    |    |    |    | child_window(title="扫描查询", control_type="Text")
   |    |    |    |    | 
   |    |    |    |    | Static - ''    (L121, T705, R128, B724)
   |    |    |    |    | ['\uf0da9', 'Static29', '\uf0daStatic9']
   |    |    |    |    | child_window(title="", control_type="Text")
   |    |    |    | 
   |    |    |    | MenuItem - '新闻管理 '    (L93, T740, R318, B795)
   |    |    |    | ['MenuItem10', '新闻管理 \uf0daMenuItem', '新闻管理 \uf0da']
   |    |    |    | child_window(title="新闻管理 ", control_type="MenuItem")
   |    |    |    |    | 
   |    |    |    |    | Static - '新闻管理'    (L135, T755, R206, B779)
   |    |    |    |    | ['新闻管理', 'Static30', '新闻管理Static']
   |    |    |    |    | child_window(title="新闻管理", control_type="Text")
   |    |    |    |    | 
   |    |    |    |    | Static - ''    (L121, T759, R128, B778)
   |    |    |    |    | ['\uf0da10', 'Static31', '\uf0daStatic10']
   |    |    |    |    | child_window(title="", control_type="Text")
   |    |    |    | 
   |    |    |    | MenuItem - '监控管理 '    (L93, T794, R318, B849)
   |    |    |    | ['监控管理 \uf0da', 'MenuItem11', '监控管理 \uf0daMenuItem']
   |    |    |    | child_window(title="监控管理 ", control_type="MenuItem")
   |    |    |    |    | 
   |    |    |    |    | Static - '监控管理'    (L135, T809, R206, B833)
   |    |    |    |    | ['Static32', '监控管理', '监控管理Static']
   |    |    |    |    | child_window(title="监控管理", control_type="Text")
   |    |    |    |    | 
   |    |    |    |    | Static - ''    (L121, T813, R128, B832)
   |    |    |    |    | ['\uf0da11', 'Static33', '\uf0daStatic11']
   |    |    |    |    | child_window(title="", control_type="Text")
   |    |    |    | 
   |    |    |    | MenuItem - '报表分析 '    (L93, T848, R318, B903)
   |    |    |    | ['MenuItem12', '报表分析 \uf0da', '报表分析 \uf0daMenuItem']
   |    |    |    | child_window(title="报表分析 ", control_type="MenuItem")
   |    |    |    |    | 
   |    |    |    |    | Static - '报表分析'    (L135, T863, R206, B887)
   |    |    |    |    | ['报表分析', 'Static34', '报表分析Static']
   |    |    |    |    | child_window(title="报表分析", control_type="Text")
   |    |    |    |    | 
   |    |    |    |    | Static - ''    (L121, T867, R128, B886)
   |    |    |    |    | ['\uf0da12', 'Static35', '\uf0daStatic12']
   |    |    |    |    | child_window(title="", control_type="Text")
   |    |    |    | 
   |    |    |    | MenuItem - '统计分析 '    (L93, T902, R318, B957)
   |    |    |    | ['MenuItem13', '统计分析 \uf0da', '统计分析 \uf0daMenuItem']
   |    |    |    | child_window(title="统计分析 ", control_type="MenuItem")
   |    |    |    |    | 
   |    |    |    |    | Static - '统计分析'    (L135, T917, R206, B941)
   |    |    |    |    | ['统计分析', '统计分析Static', 'Static36']
   |    |    |    |    | child_window(title="统计分析", control_type="Text")
   |    |    |    |    | 
   |    |    |    |    | Static - ''    (L116, T922, R134, B940)
   |    |    |    |    | ['\uf0da13', 'Static37', '\uf0daStatic13']
   |    |    |    |    | child_window(title="", control_type="Text")
   |    |    |    | 
   |    |    |    | Menu - ''    (L0, T0, R0, B0)
   |    |    |    | ['Menu3']
   |    |    |    | child_window(auto_id="rc-menu-uuid-84804-1-593158-popup", control_type="Menu")
   |    |    |    |    | 
   |    |    |    |    | MenuItem - '最晚签收查询'    (L0, T0, R0, B0)
   |    |    |    |    | ['MenuItem14', '最晚签收查询', '最晚签收查询MenuItem', '最晚签收查询0', '最晚签收查询1']
   |    |    |    |    | child_window(title="最晚签收查询", control_type="MenuItem")
   |    |    |    |    | 
   |    |    |    |    | MenuItem - '货量预报查询(老)'    (L0, T0, R0, B0)
   |    |    |    |    | ['MenuItem15', '货量预报查询(老)MenuItem', '货量预报查询(老)']
   |    |    |    |    | child_window(title="货量预报查询(老)", control_type="MenuItem")
   |    |    |    |    | 
   |    |    |    |    | MenuItem - '是否签收统计(老)'    (L0, T0, R0, B0)
   |    |    |    |    | ['MenuItem16', '是否签收统计(老)', '是否签收统计(老)MenuItem', '是否签收统计(老)0', '是否签收统计(老)1']
   |    |    |    |    | child_window(title="是否签收统计(老)", control_type="MenuItem")
   |    |    |    |    | 
   |    |    |    |    | MenuItem - '网点应到件统计'    (L0, T0, R0, B0)
   |    |    |    |    | ['MenuItem17', '网点应到件统计', '网点应到件统计MenuItem']
   |    |    |    |    | child_window(title="网点应到件统计", control_type="MenuItem")
   |    |    |    |    | 
   |    |    |    |    | MenuItem - '重量差异监控'    (L0, T0, R0, B0)
   |    |    |    |    | ['MenuItem18', '重量差异监控MenuItem', '重量差异监控']
   |    |    |    |    | child_window(title="重量差异监控", control_type="MenuItem")

```

  • 写回答

8条回答 默认 最新

  • threenewbee 2023-07-05 13:04
    关注
    获得1.65元问题酬金

    用FindWindow和FindChildWindows一层一层找下去(这两个函数都是根据窗口类和标题找到窗口句柄)
    最后模拟点击,发送 wm_lbuttondown wm_lbuttonup

    评论

报告相同问题?

问题事件

  • 系统已结题 7月13日
  • 创建了问题 7月5日