UiPath Documentation
robot
2021.10
false
机器人用户指南
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

设置字段

Robot JavaScript SDK 的“设置”属性使您可以个性化并改善对浏览器插件设置的控制。

class Settings {
  portNumber: number;
  pollTimeInterval: number;
  disableTelemetry: boolean;
  appOrigin: string;
}
class Settings {
  portNumber: number;
  pollTimeInterval: number;
  disableTelemetry: boolean;
  appOrigin: string;
}
属性描述
portNumber允许您配置运行后端服务的自定义端口。默认端口号为 2323。请注意,这仅适用于企业版安装。
pollTimeInterval允许您指定 Robot JavaScript SDK 持续跟踪网页中流程执行的经过时间(以毫秒为单位)。默认值为 250 毫秒。此值可确定网页浏览器的轮询频率
disableTelemetry允许您禁用遥测标志。默认值为 false
appOrigin允许您指定使用 SDK 的应用程序。默认值从 window.location.origin 类别中选取。
const robot = UiPathRobot.init();
robot.settings.portNumber = 1234;
robot.settings.pollTimeInterval = 1000;
robot.settings.disableTelemetry = true;
robot.settings.appOrigin = 'MyApp';
const robot = UiPathRobot.init();
robot.settings.portNumber = 1234;
robot.settings.pollTimeInterval = 1000;
robot.settings.disableTelemetry = true;
robot.settings.appOrigin = 'MyApp';

插件设定

若要更改插件设置,需要在“机器人插件”文件夹中创建名为 RobotJSAddOn.config 的配置文件,即:

C:\ProgramData\UiPath\Robot JS Add-on\RobotJSAddOn.config

配置文件需要包含以下内容:

<?xml version="1.0" encoding="utf-8"?>
<appSettings>
    <add key="ListenerPort" value="2323" />
    <add key="PortDiscoveryServiceEndpoint" value="http://127.0.0.1:2323" />
    <add key="TokenExpiryInDays" value="30" />
    <add key="AuthenticationProtocol" value="Custom" />
</appSettings>
<?xml version="1.0" encoding="utf-8"?>
<appSettings>
    <add key="ListenerPort" value="2323" />
    <add key="PortDiscoveryServiceEndpoint" value="http://127.0.0.1:2323" />
    <add key="TokenExpiryInDays" value="30" />
    <add key="AuthenticationProtocol" value="Custom" />
</appSettings>
属性 描述

ListenerPort

UiPath.RobotJS.ServiceHost.exe 在已配置的端口上启动 Http 侦听器,其中包含该系统上活动用户会话中其他本地侦听器的相关信息。请注意,此处的端口值必须与“SDK 设置”中配置的端口值相符。

PortDiscoveryServiceEndpoint

UiPath.RobotJS.UserHost.exe 在随机端口上启动 Http 侦听器,并在侦听器通过 UiPath.RobotJS.ServiceHost.exe 流程运行时进行注册。在用户会话上运行的本地侦听器需要了解来自 UiPath.RobotJS.ServiceHost.exe 的 “Http 侦听器”正在哪个端口和端点上运行。

TokenExpiryInDays

Any request coming from a new domain needs to have consent from the user to allow access of UiPath® Robots from a web application. These consents are valid for the said number of days mentioned in this setting.

AuthenticationProtocol

Http 侦听器实例之间使用加密的用户信息进行通信。默认情况下,我们的自定义加密用于确定机器人请求中的用户信息。将此值更改为 ““ 将退回到 Windows 提供的“NTML 身份验证”。请注意,如果将设置更改为使用“NTML 身份验证”,则还需要更改浏览器设置,以允许一并发送 Windows 用户名与请求。做法如下:

  • 访问 Internet Explorer → 工具设置 → Internet 选项 → 安全选项卡 → 本地网络或已信任的站点
  • 单击“站点”按钮以编辑站点选项。
  • 单击“高级”以编辑该区域的 UrL 列表。
  • http://127.0.0.1 添加到 URL 列表以启用“NTLM 身份验证”

默认覆盖

It is possible to customize the consent screen displayed when a request is raised from a new domain. There are currently two screens that are delivered with the Robot JavaScript SDK:

同意提示

The consent-prompt overlay is displayed when a request to access the UiPath® Assistant is raised from a new domain.

缺少组件

当本地计算机上不存在所需插件时,将显示 missing-components 覆盖。

可以按照下方示例配置覆盖消息。

// Consent code will be written to the console instead of showing default overlay
// Error logged to console when required components are missing insread of showing
// default error overlay
const robot = UiPathRobot.init();
robot.on('consent-prompt', function(consentCode){ console.log(consentCode) });
robot.on('missing-components', function(){ console.log('Missing components') });
// Consent code will be written to the console instead of showing default overlay
// Error logged to console when required components are missing insread of showing
// default error overlay
const robot = UiPathRobot.init();
robot.on('consent-prompt', function(consentCode){ console.log(consentCode) });
robot.on('missing-components', function(){ console.log('Missing components') });

SDK 的设置

class Settings {
  portNumber: number;
  pollTimeInterval: number;
  disableTelemetry: boolean;
  appOrigin: string;
}
class Settings {
  portNumber: number;
  pollTimeInterval: number;
  disableTelemetry: boolean;
  appOrigin: string;
}
属性描述
portNumber允许您配置运行后端服务的自定义端口。默认端口号为 2323。请注意,这仅适用于企业版安装。
pollTimeIntervalAllows you to specify the time in milliseconds in which the Robot JavaScript SDK keeps track of a process execution from a web page. The default value is 250 milliseconds. This value determines the polling frequency from the web browser
disableTelemetry允许您禁用遥测标志。默认值为 false
appOrigin允许您指定使用 SDK 的应用程序。默认值从 window.location.origin 类别中选取。
const robot = UiPathRobot.init();
robot.settings.portNumber = 1234;
robot.settings.pollTimeInterval = 1000;
robot.settings.disableTelemetry = true;
robot.settings.appOrigin = 'MyApp';
const robot = UiPathRobot.init();
robot.settings.portNumber = 1234;
robot.settings.pollTimeInterval = 1000;
robot.settings.disableTelemetry = true;
robot.settings.appOrigin = 'MyApp';
  • 插件设定
  • 默认覆盖
  • SDK 的设置

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新