البرنامج التعليمي pyOpenRPA. إدارة تطبيقات واجهة المستخدم الرسومية ذات الإطارات

خاصة بالنسبة لحبر ، أنا أبدأ سلسلة من المقالات التعليمية حول استخدام منصة RPA OpenRPA . يسعدني تلقي تعليقاتكم وملاحظاتكم إذا كانت لديكم أية أسئلة. آمل ألا تتركك هذه القصة غير مبالية.



دروس pyOpenRPA.  إدارة تطبيقات واجهة المستخدم الرسومية ذات الإطارات



في وقت سابق كتبت أن OpenRPA هو أول منصة RPA مفتوحة المصدر تسمح لك بالتخلص تمامًا من نظرائهم المدفوعين RPA. وكما اتضح في هذه العملية ، فإن هذا الموضوع يجعل من الممكن ليس فقط إزالة الشركات من "إبرة الترخيص" ، ولكن أيضًا لزيادة تأثيرات الأعمال الناتجة من الروبوتات المطورة. بعد كل شيء ، تبين أن بنية RPA الجديدة "أخف" بكثير ، ونتيجة لذلك ، أسرع.



شكرًا لجميع القراء الذين أبدوا اهتمامًا بمقالتي السابقة - إنني أقدر حقًا آراء الآخرين ، لأن هذا هو ما يسمح لي أن أقدم للجمهور الحلول الأكثر صلة. شكرا لك مرة أخرى على اهتمامك!



في إطار هذه المقالة ، سيتم إعطاء تعليمات تفصيلية حول تطوير روبوت يتعامل مع تطبيقات واجهة المستخدم الرسومية النافذة.



GUI , WEB .



. OpenRPA pyOpenRPA



RPA , : OpenRPA pyOpenRPA.



?



, OpenRPA "", " ". , . pyOpenRPA , RPA - . ( ). , , .



OpenRPA : , , RPA , . open source , , — . RPA , RPA . , ( RPA , ). .





pyOpenRPA — RPA : , . , , .



( ):







, GUI , .



. , , .



?



Notepad_human



?



Notepad_pyOpenRPA





UI — UIO GUI . , , , - .



, , — UIO. UIO, UIO c , . — .







  • hidden — GUI

  • disabled — (, ..)







  • left click —

  • right click —

  • type text —

  • scroll up —

  • scroll down —

  • scroll left —

  • scroll right —



, , , , "" . , , , () . , GUI .



UIO?



UIO — User Interface Object ( pyOpenRPA). , , pywinauto (, ).



, , . , UIO UIO .



UIO (UIOSelector)



UIO — ( UIO). UIO , pyOpenRPA UIO, , UIO. UIO UIO UIO.



, UIO — , 0, 1 n UIO.



— , UIO:



[
    {
        "depth_start" :: [int, start from 1] :: ,     (  1),
        "depth_end" :: [int, start from 1] :: ,     (  1),
        "ctrl_index" || "index" :: [int, starts from 0] ::  UIO     UIO,
        "title" :: [str] ::    *title*   UIO,
        "title_re" :: [str] ::   (python )   UIO,    *title*      ,
        "rich_text" :: [str] ::    *rich_text*   UIO,
        "rich_text_re" :: [str] ::   (python )   UIO,    *rich_text*      ,
        "class_name" :: [str] ::    *class_name*   UIO,
        "class_name_re" :: [str] ::   (python )   UIO,    *class_name*      ,
        "friendly_class_name" :: [str] ::    *friendly_class_name*   UIO,
        "friendly_class_name_re" :: [str] ::   (python )   UIO,    *friendly_class_name*      ,
        "control_type" :: [str] ::    *control_type*   UIO,
        "control_type_re" :: [str] ::   (python )   UIO,    *control_type*      ,
        "is_enabled" :: [bool] :: ,  UIO    ,
        "is_visible" :: [bool] :: ,  UIO   ,
        "backend" :: [str, "win32" || "uia"] ::     UIO (  "win32"). !           UIO .        .
    },
    { ...  UIO    }
]


UIO



[
    {"class_name":"CalcFrame", "backend":"win32"}, #  UIO 1-  
    {"title":"Hex", "depth_start":3, "depth_end": 3} #  UIO 1+3-   (    depth_start|depth_stop,    UIO)
]


PS. UIO UIDesktop (pyOpenRPA/Robot/UIDesktop.py). .

UIDesktop



( )



— pyOpenRPA.



: , "". "", .



0. Python 3 ( pyOpenRPA)



RPA , pyOpenRPA . RPA (, , ), pyOpenRPA , .



pyOpenRPA:



  • 1, . GitLab
  • 2, . pyOpenRPA Python 3 (pip install pyOpenRPA)


1.



, , . . , — GUI .



:



  • "RobotCalc":

    • "RobotCalc_1.py" — 1,
    • "RobotCalc_1_Run_x64.cmd" — 1
    • "RobotCalc_2.py" — 2,
    • "RobotCalc_2_Run_x64.cmd" — 2


.cmd — .



"RobotCalc_1_Run_x64.cmd" ( "RobotCalc_2_Run_x64.cmd" ):



cd %~dp0 
..\Resources\WPy64-3720\python-3.7.2.amd64\python.exe "RobotCalc_1.py"
pause >nul


2. pyOpenRPA UIO



  • (win + r > calc > enter)


pyOpenRPA GitLab ( 1, ):



  • cmd web pyOpenRPA "pyOpenRPA\Studio\pyOpenRPA.Studio_x64.cmd"


pyOpenRPA pip install pyOpenRPA ( 2, ):



  • python : python -m pyOpenRPA.Studio "..\Studio\SettingsStudioExample.py", SettingsStudioExample.py — pyOpenRPA. pyOpenRPA GitLab


5 — 15 . web pyOpenRPA (. )



pyOpenRPA_studio

web pyOpenRPA



  • GUI UI ( "Mouse search")
  • (alt + tab)
  • , , . radio Hex. pyOpenRPA — , UI , .


calc_radiobutton



pyOpenRPA UI



  • , UI ctrl 2-4 , WEB UI , .


pyOpenRPA_studio_calc_ui_hex



pyOpenRPA UI UI ( ctrl)



  • , , , "Highlight" UI , . UI , .



  • UI , UIO (UIO Python 3)





pyOpenRPA_studio_calc_ui_hex_uio



pyOpenRPA UIO UI



  • UI 4- title = "Hex". pyOpenRPA UIO UI . , UI .



  • UIO :



    [{"title":"","class_name":"CalcFrame","backend":"win32"},{"ctrl_index":0},{"ctrl_index":6},{"ctrl_index":1}]


    :





[{"class_name":"CalcFrame","backend":"win32"},{ "title":"Hex", "depth_start":3, "depth_end": 3}]


  • "title":"" , UI . "title":"Hex" "depth_start":3, "depth_end": 3 ( , ). "class_name" , class_name = CalcFrame, backend pyOpenRPA, UI (win32 uia, + -)
  • "Hightlight element" , UI , -, pyOpenRPA ( UI — UIO )


  • UIO : UI , . UI , , . , UI UIO pyOpenRPA.Robot.UIDesktop.UIOSelector_Exist_Bool



    lCalcHex_IsExistBool = UIDesktop.UIOSelector_Exist_Bool(inUIOSelector=[{"class_name":"CalcFrame","backend":"win32"},{ "title":"Hex", "depth_start":3, "depth_end": 3}]) #   UI   UIO 


  • , , win32 — , (. ).





مبرمج احسب فيد



""



menu_select UIO GUI .



  • pyOpenRPA UIO



    lUIOSelectorCalculator = [{"title":"","class_name":"CalcFrame","backend":"win32"}] #  UIO    pyOpenRPA


  • UIO UIO , menu_select,



    lUIOCalculator = UIDesktop.UIOSelector_Get_UIO(inSpecificationList=lUIOSelectorCalculator) #  UIO 
    lUIOCalculator.menu_select("& -> &") #    




3.



UIO , . RobotCalc_1.py , (python.exe "RobotCalc_1.py") c .



from pyOpenRPA.Robot import UIDesktop #  ,    UI  GUI 
import time #   
import os #   ,   ,   
lUIOSelectorCalculator = [{"title":"","class_name":"CalcFrame","backend":"win32"}] #  UIO    pyOpenRPA
while True: #  
    lUIOCalculator = UIDesktop.UIOSelector_Get_UIO(inSpecificationList=lUIOSelectorCalculator) #  UIO 
    lCalcHex_IsExistBool = UIDesktop.UIOSelector_Exist_Bool(inUIOSelector=[{"class_name":"CalcFrame","backend":"win32"},{ "title":"Hex", "depth_start":3, "depth_end": 3}]) #   UI   UIO 
    if not lCalcHex_IsExistBool: # ,  UI  
        lUIOCalculator.menu_select("& -> &") #    
    time.sleep(1) #    1 .,      


! , . . , 1 .



. , ( ), ( )



  • UIO . , .



  • os.system





os.system("calc") #  


  • ( ) is_minimized


lUIOCalculator.is_minimized()


  • restore


lUIOCalculator.restore() #      


  • ( RobotCalc_2.py).


from pyOpenRPA.Robot import UIDesktop #  ,    UI  GUI 
import time #   
import os #   ,   ,   
lUIOSelectorCalculator = [{"title":"","class_name":"CalcFrame","backend":"win32"}] #  UIO    pyOpenRPA
while True: #  
    lExistBool = UIDesktop.UIOSelector_Exist_Bool(inUIOSelector=lUIOSelectorCalculator) #     UIO 
    if not lExistBool: #    
        os.system("calc") #  
    else: # ,     
        lUIOCalculator = UIDesktop.UIOSelector_Get_UIO(inSpecificationList=lUIOSelectorCalculator) #  UIO 
        if lUIOCalculator.is_minimized(): # ,      
            lUIOCalculator.restore() #      
        else:
            lCalcHex_IsExistBool = UIDesktop.UIOSelector_Exist_Bool(inUIOSelector=[{"class_name":"CalcFrame","backend":"win32"},{ "title":"Hex", "depth_start":3, "depth_end": 3}]) #   UI   UIO 
            if not lCalcHex_IsExistBool: # ,  UI  
                lUIOCalculator.menu_select("& -> &") #    
    time.sleep(1) #    1 .,      


PS 1. : RPA 3-4 ( ).



PS 2. UIDesktop (pyOpenRPA/Robot/UIDesktop.py)

UIDesktop





, . , . - "" (, , web ).



, , , . , RPA (, RPA , ).



, .



!




All Articles