You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ORPA-pyOpenRPA/Wiki/ENG_Guide/html/Robot/03_HowToStart.html

287 lines
11 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!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 &mdash; 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 &amp; 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> &raquo;</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
&gt; import sys &lt;br&gt;
&gt; sys.path.append(../../)&lt;br&gt;
&gt; import selenium [#Web app access](<a class="reference external" href="https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.1.-Theory-&amp;-practice:-Web-app-access-(Chrome,-Firefox,-Opera">https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.1.-Theory-&amp;-practice:-Web-app-access-(Chrome,-Firefox,-Opera</a>))&lt;br&gt;
&gt; import GUI [#Win32 &amp; UI Automation access](<a class="reference external" href="https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.2.-Theory-&amp;-practice:-Desktop-app-UI-access-(win32-and-UI-automation-dlls">https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.2.-Theory-&amp;-practice:-Desktop-app-UI-access-(win32-and-UI-automation-dlls</a>)) &lt;br&gt;
&gt; import pyautogui [#Screen capture/recognition](<a class="reference external" href="https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.4.-Theory-&amp;-practice:-Screen-capture-&amp;-image-recognition">https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.4.-Theory-&amp;-practice:-Screen-capture-&amp;-image-recognition</a>) [#Mouse manipulation](<a class="reference external" href="https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.3.-Theory-&amp;-practice:-Keyboard-&amp;-mouse-manipulation">https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.3.-Theory-&amp;-practice:-Keyboard-&amp;-mouse-manipulation</a>)&lt;br&gt;
&gt; import cv2 [#Computer vision](<a class="reference external" href="https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.4.-Theory-&amp;-practice:-Screen-capture-&amp;-image-recognition">https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.4.-Theory-&amp;-practice:-Screen-capture-&amp;-image-recognition</a>)&lt;br&gt;
&gt; import keyboard [#Keyboard manipulation](<a class="reference external" href="https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.3.-Theory-&amp;-practice:-Keyboard-&amp;-mouse-manipulation">https://gitlab.com/UnicodeLabs/OpenRPA/wikis/05.3.-Theory-&amp;-practice:-Keyboard-&amp;-mouse-manipulation</a>)&lt;br&gt;</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: &lt;br&gt;
&gt; cd “OpenRPAResourcesWPy32-3720python-3.7.2”&lt;br&gt;
&gt; python.exe “path to your python script.py”&lt;br&gt;</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: &lt;br&gt;
&gt; cd “OpenRPAResourcesWPy64-3720python-3.7.2.amd64”&lt;br&gt;
&gt; python.exe “path to your python script.py”&lt;br&gt;</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: &lt;br&gt;
&gt; cd %~dp0
&gt; copy /Y ..ResourcesWPy32-3720python-3.7.2python.exe ..ResourcesWPy32-3720python-3.7.2OpenRPAOrchestrator.exe
&gt; …ResourcesWPy32-3720python-3.7.2OpenRPAOrchestrator.exe orchestratorMain.py
&gt; pause &gt;nul</p>
<p>## Use in studio script (n/a)</p>
<p>&gt; import sys &lt;br&gt;
&gt; sys.path.append(../../)&lt;br&gt;
&gt; import GUI&lt;br&gt;
&gt; import keyboard&lt;br&gt;
&gt; import subprocess&lt;br&gt;
&gt; import time&lt;br&gt;
&gt;
&gt; #Highlight the UI Object in Folder explorer&lt;br&gt;
&gt; GUI.UIOSelector_FocusHighlight([{“class_name”:”CabinetWClass”,”backend”:”uia”},{“ctrl_index”:2},{“ctrl_index”:0},{“ctrl_index”:2},{“ctrl_index”:0}])&lt;br&gt;
&gt;
&gt;#Wait 2 seconds&lt;br&gt;
&gt;time.sleep(3)&lt;br&gt;
&gt;
&gt;#Loop: get child element of UI List&lt;br&gt;
&gt;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():&lt;br&gt;
&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(str(lItem))&lt;br&gt;</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>
&#169; 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>