UiPath Documentation
robot
2023.10
false
Guide du développeur UiPath Robot
  • Robot JavaScript SDK
    • À propos du Robot JavaScript SDK
    • Étapes de configuration
Important :
La localisation du contenu nouvellement publié peut prendre 1 à 2 semaines avant d’être disponible.

Étapes de configuration

Prerequisites and configuration for the Robot JavaScript SDK, including installing the UiPath JavaScript Add-On and granting origin access.

This page covers the prerequisites and configuration for using the Robot JavaScript SDK in custom web applications, including setting up browser and Robot consent access, installing the SDK, and configuring the JavaScript Add-On.

Prérequis

The following prerequisites must be met for automation projects to use the Robot JavaScript SDK:

  • Version Studio et Robot 2021.10 ou ultérieure installée
  • Module complémentaire JavaScript UiPath installé sur la machine Robot

Autoriser l'accès

When the UiPath Robot JavaScript Add-On is run, access must be granted for your custom application or web page to connect to the Robot. The access is handled by a two-step dialog — both steps must be confirmed to run RobotJS. Both dialogs support automation as described in the following sections.

Boîte de dialogue d'accès au navigateur

Cette étape fait référence au navigateur qui demande les autorisations pour ouvrir l'Assistant UiPath.

Acceptation automatique de la boîte de dialogue d'accès du navigateur

The uipath-web://* value, added as a trusted URL in the browser's settings, automates this dialog. The uipath-web://* refers to the UiPath Robot web protocol handler.

Remarque :

En fonction du navigateur utilisé, différents paramètres doivent être configurés. Par exemple, si vous utilisez Google Chrome, suivez les étapes décrites dans la documentation de Google Chrome URLAllowlist.

La boîte de dialogue de consentement du robot est utilisée pour autoriser la connexion entre le Robot JavaScript SDK et l'exécuteur de Robot.

The UIPATH_ROBOTJS_ALLOWLIST System Environment Variable automatically accepts the robot consent dialog.

The variable value must contain the URLs of your custom application or web page, separated by semicolons. The URL should contain the port number only if a standard port is not used (80 or 443).

Le robot JavaScript SDK

Ce SDK fournit toutes les méthodes et propriétés nécessaires que vous pouvez inclure dans votre application personnalisée ou votre page Web. Vous pouvez le télécharger comme suit :

NPM

The npm package is available with TypeScript bindings. To include it in your project:

  1. Run the following command at the root of your project directory:

    npm install --save @uipath/robot
    npm install --save @uipath/robot
    

CDN

For CDN:

  1. Add the following script tag before the closing </body> tag:

    <body>
    ...
    ...
    <script href="//download.uipath.com/js/1.3.2/UiPathRobot.js"></script>
    </body>
    <body>
    ...
    ...
    <script href="//download.uipath.com/js/1.3.2/UiPathRobot.js"></script>
    </body>
    

Direct download

Download the Robot JavaScript SDK via direct download.

Paramètres de module complémentaire

To configure add-on settings:

  1. Open the uipath.config file in the installation folder.
  2. Add the ListenerPort and TokenExpiryInDays parameters to the <robotJsSettings> section. By default, the section does not contain any keys:
<robotJsSettings>
    <add key="ListenerPort" value="2323" />
    <add key="TokenExpiryInDays" value="30" />
</robotJsSettings>
<robotJsSettings>
    <add key="ListenerPort" value="2323" />
    <add key="TokenExpiryInDays" value="30" />
</robotJsSettings>
AttributDescription
ListenerPortThe UiPath.RobotJS.ServiceHost.exe starts a HttpListener on the configured port and contains the information about other local listeners from the active user session on that system. The port value must match the one configured in the SDK Settings.
TokenExpiryInDaysToute demande provenant d’un nouveau domaine doit obtenir le consentement de l’utilisateur pour permettre l’accès aux UiPath Robots à partir d’une application Web. Ces consentements sont valables pour le nombre de jours mentionnés dans ce paramètre.

Cette page vous a-t-elle été utile ?

Connecter

Besoin d'aide ? Assistance

Vous souhaitez apprendre ? UiPath Academy

Vous avez des questions ? UiPath Forum

Rester à jour