UiPath Documentation
activities
latest
false
用户界面自动化活动
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

设备构建器类

移动自动化 API 中的“设备构建器类”:使用此类可配置要连接的设备。

使用此类配置要连接的设备。

定义

命名空间:UiPath.MobileAutomation.API.Models

程序集:UiPath.MobileAutomation.API(在 UiPath.MobileAutomation.API.dll 中)

语法

public class DeviceBuilder
public class DeviceBuilder

DeviceBuilder类型公开以下成员。

构造函数

DeviceBuilder(
	string appiumUrl,
	string displayName
)
DeviceBuilder(
	string appiumUrl,
	string displayName
)

DeviceBuilder:初始化 DeviceBuilder 类的新实例。

appiumUrl字符串:Appium URL。

displayName String : 设备的名称

方法

您可以使用这些方法来构建设备。

构建

创建一个“ Device ”对象。

定义

命名空间:UiPath.MobileAutomation.API.Models

程序集:UiPath.MobileAutomation.API(在 UiPath.MobileAutomation.API.dll 中)

DeviceBuilder.Build()
public Device Build()
public Device Build()
返回值

用于创建连接的Device对象。

WithCapabilities

为设备配置其他所需功能。

定义

命名空间:UiPath.MobileAutomation.API.Models

程序集:UiPath.MobileAutomation.API(在 UiPath.MobileAutomation.API.dll 中)

DeviceBuilder.WithCapabilities
WithCapabilities(
	Dictionary<string, string> capabiltiies
)
WithCapabilities(
	Dictionary<string, string> capabiltiies
)

capabilities字典 < String String >:设备所需的其他功能。请访问Appium 功能,了解有关可以配置的其他功能。

返回值

DeviceBuilder

返回更新的设备构建器。

WithCapability

为设备配置单个功能。

定义

命名空间:UiPath.MobileAutomation.API.Models

程序集:UiPath.MobileAutomation.API(在 UiPath.MobileAutomation.API.dll 中)

DeviceBuilder.WithCapability(string, string)
WithCapability(
	string key,
	string value
)
WithCapability(
	string key,
	string value
)

key String :要配置的功能的名称。请访问Appium 功能,了解有关可以配置的其他功能。

value String :输入功能值。

返回值

DeviceBuilder

返回更新的设备构建器。

WithDeviceName

指定设备名称。

定义

命名空间:UiPath.MobileAutomation.API.Models

程序集:UiPath.MobileAutomation.API(在 UiPath.MobileAutomation.API.dll 中)

DeviceBuilder.DeviceName(string)
WithDeviceName(
	string deviceName
)
WithDeviceName(
	string deviceName
)

deviceName String : 要自动化的特定设备的名称。(例如, iPhone 13)。

返回值

DeviceBuilder

返回更新的设备构建器。

WithHttpHeaders

将自定义 http 标头添加到 Appium 生成的默认标头中,以在使用代理后,提供更轻松的移动测试体验。自定义 Http 标头允许移动测试通过明确添加仅接受某些标头的代理使用这些标头。您添加的自定义标头不会覆盖已存在的标头,但系统会将标头添加到可支持的值的集合中。

定义

命名空间:UiPath.MobileAutomation.API.Models

程序集:UiPath.MobileAutomation.API(在 UiPath.MobileAutomation.API.dll 中)

DeviceBuilder.WithHttpHeaders(string)
WithHttpHeaders(
	Dictionary<string, string> headers
)
WithHttpHeaders(
	Dictionary<string, string> headers
)

headers字典< String , String >: 要添加的自定义标头的名称和值。

返回值

DeviceBuilder

返回更新的设备构建器。

WithPlatformName

指定设备的平台名称。

定义

命名空间:UiPath.MobileAutomation.API.Models

程序集:UiPath.MobileAutomation.API(在 UiPath.MobileAutomation.API.dll 中)

DeviceBuilder.WithPlatformName(PaltformType)
WithPlatformName(
	PlatformType type
)
WithPlatformName(
	PlatformType type
)

type PlatformType :托管应用程序或浏览器的平台类型。

返回值

DeviceBuilder

返回更新的设备构建器。

WithPlatformVersion

指定设备平台的版本。

定义

命名空间:UiPath.MobileAutomation.API.Models

程序集:UiPath.MobileAutomation.API(在 UiPath.MobileAutomation.API.dll 中)

DeviceBuilder.WithPlatformVersion(string)
WithPlatformVersion(
	string version
)
WithPlatformVersion(
	string version
)

version String :平台的版本。(例如,iOS 16)

返回值

DeviceBuilder

返回更新的设备构建器。

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新