|
|
|
|
|
|
|
|
<!DOCTYPE html>
|
|
|
<html class="writer-html5" lang="en" >
|
|
|
<head>
|
|
|
<meta charset="utf-8" />
|
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
|
|
|
<title>3. How to start — pyOpenRPA v1.2.0 documentation</title>
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
|
|
|
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--[if lt IE 9]>
|
|
|
<script src="../_static/js/html5shiv.min.js"></script>
|
|
|
<![endif]-->
|
|
|
|
|
|
|
|
|
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
|
|
|
<script src="../_static/jquery.js"></script>
|
|
|
<script src="../_static/underscore.js"></script>
|
|
|
<script src="../_static/doctools.js"></script>
|
|
|
|
|
|
<script type="text/javascript" src="../_static/js/theme.js"></script>
|
|
|
|
|
|
|
|
|
<link rel="index" title="Index" href="../genindex.html" />
|
|
|
<link rel="search" title="Search" href="../search.html" />
|
|
|
<link rel="next" title="4. Dependencies" href="04_Dependencies.html" />
|
|
|
<link rel="prev" title="2. Defs" href="02_Defs.html" />
|
|
|
</head>
|
|
|
|
|
|
<body class="wy-body-for-nav">
|
|
|
|
|
|
|
|
|
<div class="wy-grid-for-nav">
|
|
|
|
|
|
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
|
<div class="wy-side-scroll">
|
|
|
<div class="wy-side-nav-search" >
|
|
|
|
|
|
|
|
|
|
|
|
<a href="../index.html" class="icon icon-home"> pyOpenRPA
|
|
|
|
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div role="search">
|
|
|
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
|
|
|
<input type="text" name="q" placeholder="Search docs" />
|
|
|
<input type="hidden" name="check_keywords" value="yes" />
|
|
|
<input type="hidden" name="area" value="default" />
|
|
|
</form>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="caption"><span class="caption-text">GENERAL</span></p>
|
|
|
<ul>
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../01_HowToInstall.html">1. How to install</a></li>
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../02_RoadMap.html">2. Roadmap</a></li>
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../03_Copyrights_Contacts.html">3. Copyrights & Contacts</a></li>
|
|
|
</ul>
|
|
|
<p class="caption"><span class="caption-text">ROBOT</span></p>
|
|
|
<ul class="current">
|
|
|
<li class="toctree-l1"><a class="reference internal" href="01_Robot.html">1. Description</a></li>
|
|
|
<li class="toctree-l1"><a class="reference internal" href="02_Defs.html">2. Defs</a></li>
|
|
|
<li class="toctree-l1 current"><a class="current reference internal" href="#">3. How to start</a></li>
|
|
|
<li class="toctree-l1"><a class="reference internal" href="04_Dependencies.html">4. Dependencies</a></li>
|
|
|
</ul>
|
|
|
<p class="caption"><span class="caption-text">STUDIO</span></p>
|
|
|
<ul>
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../Studio/01_Studio.html">1. Description</a></li>
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../Studio/02_HowToUse.html">2. How to use</a></li>
|
|
|
</ul>
|
|
|
<p class="caption"><span class="caption-text">ORCHESTRATOR</span></p>
|
|
|
<ul>
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../Orchestrator/01_Orchestrator.html">1. Description</a></li>
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../Orchestrator/02_Defs.html">2. Defs</a></li>
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../Orchestrator/03_gSettingsTemplate.html">3. gSettings Template</a></li>
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../Orchestrator/04_HowToStart.html">4. How to start process</a></li>
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
</nav>
|
|
|
|
|
|
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
|
|
|
|
|
|
|
<nav class="wy-nav-top" aria-label="top navigation">
|
|
|
|
|
|
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
|
<a href="../index.html">pyOpenRPA</a>
|
|
|
|
|
|
</nav>
|
|
|
|
|
|
|
|
|
<div class="wy-nav-content">
|
|
|
|
|
|
<div class="rst-content">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
|
|
|
|
<ul class="wy-breadcrumbs">
|
|
|
|
|
|
<li><a href="../index.html" class="icon icon-home"></a> »</li>
|
|
|
|
|
|
<li>3. How to start</li>
|
|
|
|
|
|
|
|
|
<li class="wy-breadcrumbs-aside">
|
|
|
|
|
|
|
|
|
<a href="../_sources/Robot/03_HowToStart.rst.txt" rel="nofollow"> View page source</a>
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
<hr/>
|
|
|
</div>
|
|
|
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
|
<div itemprop="articleBody">
|
|
|
|
|
|
<div class="section" id="how-to-start">
|
|
|
<h1>3. How to start<a class="headerlink" href="#how-to-start" title="Permalink to this headline">¶</a></h1>
|
|
|
<p># Content
|
|
|
- [About](#about)
|
|
|
- [How to use](#how-to-use)
|
|
|
- [Create python script](#create-python-script)
|
|
|
- [Execute python script](#execute-python-script)</p>
|
|
|
<p># About
|
|
|
The Robot tool is the main module for production process automation. It has no graphic/console interface. All low-level actions to OS are perfoming by the Robot tool in OpenRPA.</p>
|
|
|
<p># How to use
|
|
|
You can use the robot by the several ways:
|
|
|
- In Python script
|
|
|
- In Studio script (n/a)</p>
|
|
|
<p>## Create python script
|
|
|
In order to use robot just add Robot tool folder in work directory and add line “import GUI” in your script.
|
|
|
### Example
|
|
|
> import sys <br>
|
|
|
> sys.path.append(‘../../’)<br>
|
|
|
> import selenium [#Web app access](<a class="reference external" href="https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.1.-Theory-&-practice:-Web-app-access-(Chrome,-Firefox,-Opera">https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.1.-Theory-&-practice:-Web-app-access-(Chrome,-Firefox,-Opera</a>))<br>
|
|
|
> import GUI [#Win32 & UI Automation access](<a class="reference external" href="https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.2.-Theory-&-practice:-Desktop-app-UI-access-(win32-and-UI-automation-dlls">https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.2.-Theory-&-practice:-Desktop-app-UI-access-(win32-and-UI-automation-dlls</a>)) <br>
|
|
|
> import pyautogui [#Screen capture/recognition](<a class="reference external" href="https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.4.-Theory-&-practice:-Screen-capture-&-image-recognition">https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.4.-Theory-&-practice:-Screen-capture-&-image-recognition</a>) [#Mouse manipulation](<a class="reference external" href="https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.3.-Theory-&-practice:-Keyboard-&-mouse-manipulation">https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.3.-Theory-&-practice:-Keyboard-&-mouse-manipulation</a>)<br>
|
|
|
> import cv2 [#Computer vision](<a class="reference external" href="https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.4.-Theory-&-practice:-Screen-capture-&-image-recognition">https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.4.-Theory-&-practice:-Screen-capture-&-image-recognition</a>)<br>
|
|
|
> import keyboard [#Keyboard manipulation](<a class="reference external" href="https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.3.-Theory-&-practice:-Keyboard-&-mouse-manipulation">https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.3.-Theory-&-practice:-Keyboard-&-mouse-manipulation</a>)<br></p>
|
|
|
<p>## Execute python script
|
|
|
The OpenRPA is fully portable solution. It contains own python enviroment both 32 and 64 bit versions. So, you can execute your python script in several ways:
|
|
|
- Execute in python x32 (OpenRPAResourcesWPy32-3720python-3.7.2)
|
|
|
- Execute in python x64 (OpenRPAResourcesWPy64-3720python-3.7.2.amd64)
|
|
|
- Execute from .cmd file</p>
|
|
|
<p>### Execute in the Python x32
|
|
|
To execute your python script in x32 bit version just write in command line from x32 python directory: <br>
|
|
|
> cd “OpenRPAResourcesWPy32-3720python-3.7.2”<br>
|
|
|
> python.exe “path to your python script.py”<br></p>
|
|
|
<p>### Execute in the Python x64
|
|
|
To execute your python script in x32 bit version just write in command line from x32 python directory: <br>
|
|
|
> cd “OpenRPAResourcesWPy64-3720python-3.7.2.amd64”<br>
|
|
|
> python.exe “path to your python script.py”<br></p>
|
|
|
<p>### Execute from .cmd file
|
|
|
In order to simplify the execution process you can write several code lines in file with the .cmd extansion: <br>
|
|
|
> cd %~dp0
|
|
|
> copy /Y ..ResourcesWPy32-3720python-3.7.2python.exe ..ResourcesWPy32-3720python-3.7.2OpenRPAOrchestrator.exe
|
|
|
> …ResourcesWPy32-3720python-3.7.2OpenRPAOrchestrator.exe orchestratorMain.py
|
|
|
> pause >nul</p>
|
|
|
<p>## Use in studio script (n/a)</p>
|
|
|
<p>> import sys <br>
|
|
|
> sys.path.append(‘../../’)<br>
|
|
|
> import GUI<br>
|
|
|
> import keyboard<br>
|
|
|
> import subprocess<br>
|
|
|
> import time<br>
|
|
|
>
|
|
|
> #Highlight the UI Object in Folder explorer<br>
|
|
|
> GUI.UIOSelector_FocusHighlight([{“class_name”:”CabinetWClass”,”backend”:”uia”},{“ctrl_index”:2},{“ctrl_index”:0},{“ctrl_index”:2},{“ctrl_index”:0}])<br>
|
|
|
>
|
|
|
>#Wait 2 seconds<br>
|
|
|
>time.sleep(3)<br>
|
|
|
>
|
|
|
>#Loop: get child element of UI List<br>
|
|
|
>for lItem in GUI.UIOSelector_Get_UIO([{“class_name”:”CabinetWClass”,”backend”:”uia”},{“ctrl_index”:2},{“ctrl_index”:0},{“ctrl_index”:2},{“ctrl_index”:0}]).children():<br>
|
|
|
> &nbsp; &nbsp; &nbsp; &nbsp; print(str(lItem))<br></p>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
<footer>
|
|
|
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
|
<a href="04_Dependencies.html" class="btn btn-neutral float-right" title="4. Dependencies" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
|
<a href="02_Defs.html" class="btn btn-neutral float-left" title="2. Defs" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
|
</div>
|
|
|
|
|
|
<hr/>
|
|
|
|
|
|
<div role="contentinfo">
|
|
|
<p>
|
|
|
© Copyright 2021, Ivan Maslov.
|
|
|
|
|
|
</p>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
|
|
|
|
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
|
|
|
|
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
|
|
|
|
</footer>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
</section>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
jQuery(function () {
|
|
|
SphinxRtdTheme.Navigation.enable(true);
|
|
|
});
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
</html> |