Új hozzászólás Aktív témák

  • SzVFE1

    csendes tag

    válasz kovisoft #3407 üzenetére

    Igen, ahogy mondod a type_keys van használva. Bevágom akkor alább a teljes fastruktúrát, hogy látni lehessen, hogy mennyire kevés a választék. Az alábbi kóddal simán megy a beleírás és a tab váltás is. A tab control alatti pane contol-okkal szintén. Nem ragaszkodom a pywinauto-hoz, bármilyen módszer tökéletes lenne, amivel parancsokat tudnék küldeni a MobaXterm adott tab-jába és szöveget tudnék kiolvasni belőle.

    from pywinauto.application import Application
    app = Application(backend='uia').start('"C:\\Program Files (x86)\\Mobatek\\MobaXterm\\MobaXterm.exe"').connect(title='val',timeout=100)
    textEditor = app.val.child_window(control_type="Tab").wrapper_object()
    textEditor.type_keys("^{TAB 2}")
    textEditor.type_keys("test",with_spaces = True)

    Control Identifiers:

    Dialog - 'val' (L-11, T-11, R3851, B2111)
    ['Dialog', 'val', 'valDialog', 'val0', 'val1', 'Dialog0', 'Dialog1']
    child_window(title="val", control_type="Window")
    |
    | Pane - '' (L0, T131, R3840, B173)
    | ['Pane', 'Pane0', 'Pane1']
    | child_window(auto_id="67100", control_type="Pane")
    | |
    | | Pane - '' (L0, T131, R360, B173)
    | | ['Pane2']
    | | child_window(auto_id="67102", control_type="Pane")
    | | |
    | | | Edit - '' (L6, T143, R354, B167)
    | | | ['Edit']
    | | | child_window(auto_id="67104", control_type="Edit")
    | |
    | | Pane - '' (L364, T131, R3778, B173)
    | | ['Pane3']
    | | child_window(auto_id="67108", control_type="Pane")
    |
    | Pane - '' (L0, T2070, R3840, B2100)
    | ['Pane4']
    | child_window(auto_id="67098", control_type="Pane")
    |
    | Pane - '' (L0, T64, R3840, B131)
    | ['Pane5']
    | child_window(auto_id="67096", control_type="Pane")
    |
    | Pane - '' (L0, T173, R360, B2070)
    | ['Pane6']
    | child_window(auto_id="66876", control_type="Pane")
    | |
    | | Pane - '' (L0, T173, R360, B2070)
    | | ['Pane7']
    | | child_window(auto_id="66878", control_type="Pane")
    | | |
    | | | TabControl - '' (L0, T173, R360, B2070)
    | | | ['TabControl']
    | | | child_window(auto_id="132416", control_type="Tab")
    | | | |
    | | | | Pane - '' (L52, T177, R356, B2066)
    | | | | ['Pane8']
    | | | | child_window(auto_id="66884", control_type="Pane")
    | | | | |
    | | | | | Pane - '' (L52, T177, R356, B2066)
    | | | | | ['Pane9']
    | | | | | child_window(auto_id="66886", control_type="Pane")
    | | | | | |
    | | | | | | TreeView - '' (L52, T177, R356, B2066)
    | | | | | | ['TreeView']
    | | | | | | child_window(auto_id="132424", control_type="Tree")
    | | | | | | |
    | | | | | | | TreeItem - 'User sessions' (L96, T177, R195, B211)
    | | | | | | | ['User sessionsTreeItem', 'TreeItem', 'User sessions', 'TreeItem0', 'TreeItem1']
    | | | | | | | child_window(title="User sessions", control_type="TreeItem")
    | | | | | | |
    | | | | | | | TreeItem - 'val' (L122, T211, R146, B245)
    | | | | | | | ['val2', 'valTreeItem', 'TreeItem2']
    | | | | | | | child_window(title="val", control_type="TreeItem")
    | | | |
    | | | | TabItem - '' (L2, T175, R50, B229)
    | | | | ['TabItem', 'TabItem0', 'TabItem1']
    | | | |
    | | | | TabItem - '' (L2, T229, R50, B283)
    | | | | ['TabItem2']
    | | | |
    | | | | TabItem - '' (L2, T283, R50, B337)
    | | | | ['TabItem3']
    |
    | Pane - '' (L366, T173, R3840, B2070)
    | ['Pane10']
    | child_window(auto_id="67090", control_type="Pane")
    | |
    | | ListBox - '' (L306, T113, R307, B114)
    | | ['ListBox']
    | | child_window(auto_id="67094", control_type="List")
    | |
    | | Pane - '' (L366, T173, R3840, B2070)
    | | ['Pane11']
    | | child_window(auto_id="67092", control_type="Pane")
    | | |
    | | | Dialog - '' (L366, T173, R3840, B2070)
    | | | ['Dialog2']
    | | | |
    | | | | ScrollBar - 'Függőleges' (L3814, T173, R3840, B2070)
    | | | | ['Függőleges', 'ScrollBar', 'FüggőlegesScrollBar']
    | | | | child_window(title="Függőleges", auto_id="NonClientVerticalScrollBar", control_type="ScrollBar")
    | | | | |
    | | | | | Button - 'Egy sorral fel' (L3814, T173, R3840, B199)
    | | | | | ['Egy sorral felButton', 'Button', 'Egy sorral fel', 'Button0', 'Button1']
    | | | | | child_window(title="Egy sorral fel", auto_id="UpButton", control_type="Button")
    | | | | |
    | | | | | Button - 'Egy sorral le' (L3814, T2044, R3840, B2070)
    | | | | | ['Button2', 'Egy sorral leButton', 'Egy sorral le']
    | | | | | child_window(title="Egy sorral le", auto_id="DownButton", control_type="Button")
    |
    | TitleBar - '' (L24, T-8, R3840, B34)
    | ['TitleBar']
    | |
    | | Menu - 'Rendszer' (L0, T0, R22, B22)
    | | ['Rendszer', 'Menu', 'RendszerMenu', 'Rendszer0', 'Rendszer1', 'Menu0', 'Menu1']
    | | child_window(title="Rendszer", auto_id="MenuBar", control_type="MenuBar")
    | | |
    | | | MenuItem - 'Rendszer' (L0, T0, R22, B22)
    | | | ['RendszerMenuItem', 'MenuItem', 'Rendszer2', 'MenuItem0', 'MenuItem1']
    | | | child_window(title="Rendszer", control_type="MenuItem")
    | |
    | | Button - 'Kis méret' (L3627, T11, R3698, B33)
    | | ['Button3', 'Kis méret', 'Kis méretButton']
    | | child_window(title="Kis méret", control_type="Button")
    | |
    | | Button - 'Előző méret' (L3698, T11, R3768, B33)
    | | ['Előző méretButton', 'Button4', 'Előző méret']
    | | child_window(title="Előző méret", control_type="Button")
    | |
    | | Button - 'Bezárás' (L3768, T11, R3851, B33)
    | | ['BezárásButton', 'Button5', 'Bezárás']
    | | child_window(title="Bezárás", control_type="Button")
    |
    | Menu - 'Alkalmazás' (L0, T23, R2560, B42)
    | ['AlkalmazásMenu', 'Alkalmazás', 'Menu2']
    | child_window(title="Alkalmazás", auto_id="MenuBar", control_type="MenuBar")
    | |
    | | MenuItem - '' (L0, T23, R57, B42)
    | | ['MenuItem2']
    | |
    | | MenuItem - '' (L57, T23, R116, B42)
    | | ['MenuItem3']
    | |
    | | MenuItem - '' (L115, T23, R153, B42)
    | | ['MenuItem4']
    | |
    | | MenuItem - '' (L153, T23, R208, B42)
    | | ['MenuItem5']
    | |
    | | MenuItem - '' (L209, T23, R250, B42)
    | | ['MenuItem6']
    | |
    | | MenuItem - '' (L249, T23, R298, B42)
    | | ['MenuItem7']
    | |
    | | MenuItem - '' (L299, T23, R355, B42)
    | | ['MenuItem8']
    | |
    | | MenuItem - '' (L355, T23, R407, B42)
    | | ['MenuItem9']
    | |
    | | MenuItem - '' (L407, T23, R445, B42)
    | | ['MenuItem10']

Új hozzászólás Aktív témák