
StudioX user guide
教程:使用用户界面自动化
在此示例中,我们将为以下任务创建自动化:
- 复制 Excel 文件中的值。
- 将值粘贴到桌面应用程序中的特定字段。
- 复制桌面应用程序中的交易编号。
- 将值粘贴到 Excel 文件中的单元格。
- 单击桌面应用程序中的按钮以提交数据。
- 显示一条确认消息,其中包含交易编号和从应用程序中检索到的帐户编号。
We will create a project and start by adding a Use Excel File activity to indicate the Excel file to use. We will then add a Use Application/Browser that will contain the activities that interact with the application. At the end, we will add a Message Box activity to display the confirmation message.
- 设置项目并下载必要的文件。
- Create a new blank project using the default settings.
- 使用此页面底部的按钮,通过本教程中的自动化项目下载并提取存档。将“Transaction.xlsx”文件复制到您的项目文件夹,然后双击“DoubleUI.exe”文件以打开 DoubleUI 应用程序。
- 将 Excel 文件添加到项目中。
- 在“活动”面板中,选择“资源”选项卡,然后双击“使用 Excel 文件”。“使用 Excel 文件”活动随即会添加到“设计器”面板中。
- 在“使用 Excel 文件”活动中:
-
Click Browse
to the right of the Excel file field, and then browse to and select the file Transaction.xlsx. -
在“引用为”字段中,输入
MyExcel。您已指明要使用文件 Transaction.xlsx,该文件在您的项目中将称为 MyExcel。
-
- 添加应用程序和要在其中执行的活动。
-
在“活动”面板中,选择“资源”选项卡,然后将“使用应用程序/浏览器”活动拖放到“使用 Excel 文件”活动中。“使用应用程序/浏览器”活动随即会添加到“设计器”面板中。
-
在“使用应用程序/浏览器”活动中,单击“指定应用程序”,然后将鼠标指针移至 DoubleUI 应用程序上。该窗口突出显示后,在 DoubleUI 中单击任意位置。
“使用应用程序/浏览器”活动已更新,并且该活动内出现窗口的屏幕截图。
-
In the Activities panel, select the Resources tab, and then drag a Type Into activity and drop it inside the Use Application/Browser activity. A Type Into activity is added in the Use Application/Browser activity.
-
在“键入到”活动中:
-
单击“在屏幕上指定目标”,然后将鼠标指针移到 DoubleUI.exe 应用程序中的“Cash In”字段上,并在该字段突出显示后单击该字段。文本字段将被标识为目标,其旁边的“Cash In”标签被标识为锚点。在“选择选项”窗口中,单击“确认”以保存选择。目标和锚点的图像显示在“键入到”活动中。
您已经表明要在 DoubleUI.exe 应用程序中键入“Cash In”字段。
-
Click Plus
on the right side of the Type this field, and then select MyExcel > Indicate in Excel. In the Excel file, select the B1 cell (the Cash In value) and click Confirm in the UiPath tab of the Excel ribbon. The Type this field displays your selection as [MyExcel] Sheet1!B1.您已指明要将“Cash In”值从 Excel 文件复制到 DoubleUI.exe 应用程序中的“Cash In”字段。
-
-
再重复两次步骤 3-4,添加“键入到”活动,以将 Excel 文件中的“银行内求偿支票”和“非银行内求偿支票”值(分别为单元格 B2 和 B3)复制到 DoubleUI 应用程序中的相应字段。
-
In the Activities panel, select the Resources tab, and then drag a Get Text activity and drop it inside the Use Application/Browser activity after the last Type Into activity. A Get Text activity is added in the Use Application/Browser activity.
-
在“获取文本”活动中:
-
单击“在屏幕上指定目标”,然后将鼠标指针移到 DoubleUI.exe 应用程序中的“Transaction #”值上,当该值突出显示时,单击该值。Transaction # 值被标识为目标,并且其旁边的标签被标识为锚点。在“选择选项”窗口中单击“确认”以保存选择。目标和锚点的图像显示在“获取文本”活动中。
-
Click Plus
on the right side of the Save to field, and then select MyExcel > Indicate in Excel. In the Excel file, select the B4 cell (the Transaction # value) and click Confirm in the UiPath tab of the Excel ribbon. The Save to field displays your selection as [MyExcel] Sheet1!B4.您已指明要从 DoubleUI.exe 应用程序将 Transaction # 的值复制到 Excel 文件的 Sheet1 中的 B4 单元格中。
-
-
In the Activities panel, select the Resources tab, and then drag a Click activity and drop it inside the Use Application/Browser activity after the Get Text activity. A Click activity is added in the Use Application/Browser activity.
-
在“点击”活动中,单击“在屏幕上指定目标”,然后将鼠标指针移至 DoubleUI.exe 应用程序中的“接受”按钮上,并在该按钮突出显示后,单击该按钮。“接受”按钮将被标识为目标,“取消”按钮被标识为锚点。在“选择选项”窗口中,单击“确认”以保存选择。目标和锚点的图像显示在“点击”活动中。
您已指明要单击 DoubleUI.exe 应用程序中的“接受”按钮。
-
In the Activities panel, select the Resources tab, and then drag a Get Text activity and drop it inside the Use Application/Browser activity after the Click activity. A Get Text activity is added in the Use Application/Browser activity.
-
在“获取文本”活动中:
-
单击“在屏幕上指定目标”,然后将鼠标指针移到 DoubleUI.exe 应用程序中的“Account #”值上,当该值突出显示时,单击该值。Account # 值被标识为目标,并且其旁边的标签被标识为锚点。在“选择选项”窗口中,单击“确认”以保存选择。目标和锚点的图像显示在“获取文本”活动中。
-
Click Plus
on the right side of the Save to field, and then select Save for Later Use. Enter the name Account #for the value, and click OK.您已指明要从 DoubleUI.exe 应用程序复制帐户编号的值,并将该值保存在“帐户编号”名称下,以供以后在项目中使用。

-
-
- 添加并配置“消息框”活动。
- 在“活动”面板中,选择“常用”选项卡,然后将“消息框”活动拖放到“使用 Excel 文件”活动中的“使用应用程序/浏览器”活动之后。
- In the Message Box activity, click Plus
on the right side, and then select Text. The Text Builder window appears. - 我们希望添加以显示类似于以下内容的文本:“已经为帐户编号 456 处理事务编号 123”。为此,请执行以下操作:
-
输入文本“Transaction #”。
-
Click Plus
on the right side of the window, and then select MyExcel > Indicate in Excel. In the Excel file, select the B4 cell (the Transaction # value) and click Confirm in the UiPath tab of the Excel ribbon. You have added the transaction number value from the Excel file.文本现在应如下所示:“事务编号值
[MyExcel] Sheet1!B4”。 -
输入文本“has been processed for account # ”。
-
Click Plus
on the right side of the window, and then select MyExcel > Use Saved Value > Account #. You have added the account number value that you saved for later use earlier.文本应如下所示:

-
- Click Save in the Text Builder.
- Click Save in the StudioX ribbon to save the automation, then click Run to execute the automation.The values are copied from the Excel file and entered in the DoubleUI application, the Transaction # from the DoubleUI application is copied to the Excel file, and a message box displaying the transaction and account numbers appears at the end. Download example