- Overview
- UI Automation
- Applications and technologies automated with UI Automation
- Project compatibility
- UI-ANA-016 - Pull Open Browser URL
- UI-ANA-017 - ContinueOnError True
- UI-ANA-018 - List OCR/Image Activities
- UI-DBP-006 - Container Usage
- UI-DBP-013 - Excel Automation Misuse
- UI-DBP-030 - Forbidden Variables Usage In Selectors
- UI-PRR-001 - Simulate Click
- UI-PRR-002 - Simulate Type
- UI-PRR-003 - Open Application Misuse
- UI-PRR-004 - Hardcoded Delays
- UI-REL-001 - Large Idx in Selectors
- UI-SEC-004 - Selector Email Data
- UI-SEC-010 - App/Url Restrictions
- UI-USG-011 - Non Allowed Attributes
- UX-SEC-010 - App/Url Restrictions
- UX-DBP-029 - Insecure Password Use
- UI-PST-001 - Audit Log Level in Project Settings
- UiPath Browser Migration Tool
- Clipping region
- Computer Vision Recorder
- Activate
- Anchor Base
- Attach Browser
- Attach Window
- Block User Input
- Callout
- Check
- Click
- Click Image
- Click Image Trigger
- Click OCR Text
- Click Text
- Click Trigger
- Close Application
- Close Tab
- Close Window
- Context Aware Anchor
- Copy Selected Text
- Element Attribute Change Trigger
- Element Exists
- Element Scope
- Element State Change Trigger
- Export UI Tree
- Extract Structured Data
- Find Children
- Find Element
- Find Image
- Find Image Matches
- Find OCR Text Position
- Find Relative Element
- Find Text Position
- Get Active Window
- Get Ancestor
- Get Attribute
- Get Event Info
- Get From Clipboard
- Get Full Text
- Get OCR Text
- Get Password
- Get Position
- Get Source Element
- Get Text
- Get Visible Text
- Go Back
- Go Forward
- Go Home
- Google Cloud Vision OCR
- Hide Window
- Highlight
- Hotkey Trigger
- Hover
- Hover Image
- Hover OCR Text
- Hover Text
- Image Exists
- Indicate On Screen
- Inject .NET Code
- Inject Js Script
- Invoke ActiveX Method
- Key Press Trigger
- Load Image
- Maximize Window
- Microsoft Azure Computer Vision OCR
- Microsoft OCR
- Microsoft Project Oxford Online OCR
- Minimize Window
- Monitor Events
- Mouse Trigger
- Move Window
- Navigate To
- OCR Text Exists
- On Element Appear
- On Element Vanish
- On Image Appear
- On Image Vanish
- Open Application
- Open Browser
- Refresh Browser
- Replay User Event
- Restore Window
- Save Image
- Select Item
- Select Multiple Items
- Send Hotkey
- Set Clipping Region
- Set Focus
- Set Text
- Set To Clipboard
- Set Web Attribute
- Show Window
- Start Process
- System Trigger
- Take Screenshot
- Tesseract OCR
- Text Exists
- Tooltip
- Type Into
- Type Secure Text
- Use Foreground
- Wait Attribute
- Wait Element Vanish
- Wait Image Vanish
- Application Event Trigger
- Check/Uncheck
- Check App State
- Check Element
- Click
- Click Event Trigger
- Close Popup
- Drag and Drop
- Extract Table Data
- For Each UI Element
- Get Attribute
- Get Browser Data
- Get Text
- Get URL
- Go to URL
- Highlight
- Hover
- Inject Js Script
- Keyboard Shortcuts
- Keypress Event Trigger
- Mouse Scroll
- Navigate Browser
- Select Item
- Set Browser Data
- Set Runtime Browser
- Set Text
- Take Screenshot
- Type Into
- Use Application/Browser
- Perform browser search and retrieve results using UI Automation APIs
- Web Browsing
- Find Images
- Click Images
- Trigger and Monitor Events
- Create and Override Files
- HTML Pages: Extract and Manipulate Information
- Window Manipulation
- Automated List Selection
- Find and Manipulate Window Elements
- Manage Text Automation
- Load and Process Images
- Manage Mouse Activated Actions
- Automate Application Runtime
- Automated Run of a Local Application
- Browser Navigation
- Web Automation
- Trigger Scope Example
- Computer Vision Local Server
- Mobile Automation
- Release notes
- Project compatibility
- Get Log Types
- Get Logs
- Get Page Source
- Get Device Orientation
- Get Session Identifier
- Install App
- Manage Current App
- Manage Other App
- Open DeepLink
- Open URL
- Mobile Device Connection
- Directional Swipe
- Draw Pattern
- Positional Swipe
- Press Hardware Button
- Set Device Orientation
- Take Screenshot
- Take Screenshot Part
- Element Exists
- Execute Command
- Get Attribute
- Get Selected Item
- Get Text
- Set Selected Item
- Set Text
- Swipe
- Tap
- Type Text
- Terminal
TakeScreenshot
Takes a screenshot of a specified UI element or application and saves it to a file.
Namespace: UiPath.UIAutomationNext.API.Models
Assembly: UiPath.UIAutomationNext.API.Models (in UiPath.UIAutomationNext.API.Models dll)
Overload | Description |
---|---|
TakeScreenshot(IElementDescriptor,
TakeScreenshotOptions) | Takes a screenshot of a specified UI element or application and saves it to a file, identified by a descriptor of an element from Object Repository. |
TakeScreenshot(IElementDescriptor,
String) | Takes a screenshot of a specified UI element or application and saves it to a file, identified by a descriptor of an element from Object Repository, while specifying the file name. |
TakeScreenshot(String,
TakeScreenshotOptions) | Takes a screenshot of a specified UI element or application and saves it to a file, identified by a string from Object Repository, along with other configurations. |
TakeScreenshot(String, String) | Takes a screenshot of a specified UI element or application and saves it to a file, identified by a string from Object Repository, along with other configurations. |
TakeScreenshot(RuntimeTarget,
TakeScreenshotOptions) | Takes a screenshot of a specified UI element or application and saves it to a file, identified by a runtime instance of an Object Repository element, along with other configurations. |
TakeScreenshot(TargetAnchorableModel,
TakeScreenshotOptions) | Takes a screenshot of a specified UI element or application and
saves it to a file, identified by the
TargetAnchorableModel object, along with other
configurations.
|
TakeScreenshot(TargetAnchorableModel,
String) | Takes a screenshot of a specified UI element or application and
saves it to a file, identified by the
TargetAnchorableModel object, while specifying
the file name.
|
Takes a screenshot of a specified UI element or application and saves it to a file, identified by a descriptor of an element from Object Repository.
TakeScreenhot(
IElementDescriptor elementDescriptor,
TakeScreenshotOptions takeScreenshotOptions)
TakeScreenhot(
IElementDescriptor elementDescriptor,
TakeScreenshotOptions takeScreenshotOptions)
elementDescriptor
IElementDescriptor
- The element descriptor to take the screenshot from. Leave
null
to take a screenshot of the entire desktop. takeScreenshotOptions
TakeScreenshotOptions
- Additional options to customize the screenshot. You can choose to customize:
TargetOptions
:- Timeout - Specifies the amount of time (in
seconds) to wait for the API to run before the
SelectorNotFoundException
error is thrown. The default value is 30 seconds. - DelayAfter - Delay time (in seconds) after executing the API. The default amount of time is 0.3 seconds (300 milliseconds).
- DelayBefore - Delay time (in seconds) before the API begins performing any operations. The default amount of time is 0.2 seconds (200 milliseconds).
- Timeout - Specifies the amount of time (in
seconds) to wait for the API to run before the
FileName
- The name of the file you want to save.
Takes a screenshot of a specified UI element or application and saves it to a file, identified by a descriptor of an element from Object Repository, while specifying the file name.
TakeScreenhot(
IElementDescriptor elementDescriptor,
string fileName)
TakeScreenhot(
IElementDescriptor elementDescriptor,
string fileName)
elementDescriptor
IElementDescriptor
- The element descriptor to take the screenshot from. Leave
null
to take a screenshot of the entire desktop. fileName
String
- The name of the file you want to save.
Takes a screenshot of a specified UI element or application and saves it to a file, identified by a string from Object Repository, along with other configurations.
TakeScreenhot(
string target,
TakeScreenshotOptions takeScreenshotOptions)
TakeScreenhot(
string target,
TakeScreenshotOptions takeScreenshotOptions)
target
String
- The target to take a screenshot from, identified by a string from Object
Repository. Leave
null
to take a screenshot of the entire desktop. takeScreenshotOptions
TakeScreenshotOptions
- Additional options to customize the screenshot. You can choose to customize:
TargetOptions
:- Timeout - Specifies the amount of time (in seconds)
to wait for the API to run before the
SelectorNotFoundException
error is thrown. The default value is 30 seconds. - DelayAfter - Delay time (in seconds) after executing the API. The default amount of time is 0.3 seconds (300 milliseconds).
- DelayBefore - Delay time (in seconds) before the API begins performing any operations. The default amount of time is 0.2 seconds (200 milliseconds).
- Timeout - Specifies the amount of time (in seconds)
to wait for the API to run before the
FileName
- The name of the file you want to save.
Takes a screenshot of a specified UI element or application and saves it to a file, identified by a string from Object Repository, along with other configurations.
TakeScreenhot(
string target,
string fileName)
TakeScreenhot(
string target,
string fileName)
Takes a screenshot of a specified UI element or application and saves it to a file, identified by a runtime instance of an Object Repository element, along with other configurations.
TakeScreenhot(
RuntimeTarget target,
TakeScreenshotOptions takeScreenshotOptions)
TakeScreenhot(
RuntimeTarget target,
TakeScreenshotOptions takeScreenshotOptions)
target
RuntimeTarget
- The target to take a screenshot from, identified by a runtime instance of an
Object Repository element. Leave
null
to take a screenshot of the entire desktop. takeScreenshotOptions
TakeScreenshotOptions
- Additional options to customize the screenshot. You can choose to customize:
TargetOptions
:- Timeout - Specifies the amount of time (in seconds)
to wait for the API to run before the
SelectorNotFoundException
error is thrown. The default value is 30 seconds. - DelayAfter - Delay time (in seconds) after executing the API. The default amount of time is 0.3 seconds (300 milliseconds).
- DelayBefore - Delay time (in seconds) before the API begins performing any operations. The default amount of time is 0.2 seconds (200 milliseconds).
- Timeout - Specifies the amount of time (in seconds)
to wait for the API to run before the
FileName
- The name of the file you want to save.
TargetAnchorableModel
object, along with other
configurations.
TakeScreenhot(
TargetAnchorableModel target,
TakeScreenshotOptions takeScreenshotOptions)
TakeScreenhot(
TargetAnchorableModel target,
TakeScreenshotOptions takeScreenshotOptions)
target
TargetAnchorableModel
- The target to take a screenshot from, identified by the
TargetAnchorableModel
object. Leavenull
to take a screenshot of the entire desktop. takeScreenshotOptions
TakeScreenshotOptions
- Additional options to customize the screenshot. You can choose to customize:
TargetOptions
:- Timeout - Specifies the amount of time (in seconds)
to wait for the API to run before the
SelectorNotFoundException
error is thrown. The default value is 30 seconds. - DelayAfter - Delay time (in seconds) after executing the API. The default amount of time is 0.3 seconds (300 milliseconds).
- DelayBefore - Delay time (in seconds) before the API begins performing any operations. The default amount of time is 0.2 seconds (200 milliseconds).
- Timeout - Specifies the amount of time (in seconds)
to wait for the API to run before the
FileName
- The name of the file you want to save.
TargetAnchorableModel
object, while specifying
the file name.
TakeScreenhot(
TargetAnchorableModel target,
string fileName)
TakeScreenhot(
TargetAnchorableModel target,
string fileName)
target
TargetAnchorableModel
- The target to take a screenshot from, identified by the
TargetAnchorableModel
object. Leavenull
to take a screenshot of the entire desktop. fileName
String
- The name of the file you want to save.
Here is a brief walkthrough of a sample code implementation.
This line of code sets up the file path where the screenshot is saved.
var filePath = "C:\\samplefile.jpg";
var filePath = "C:\\samplefile.jpg";
This command attaches to a screen from an already opened application.
var sampleApp = uiAutomation.Attach(Descriptors.NewApplication.NewScreen);
var sampleApp = uiAutomation.Attach(Descriptors.NewApplication.NewScreen);
TakeScreenshot
API gets invoked here, capturing the screenshot
of the newly specified element on your screen and subsequently saving it to the
defined file path.
sampleApp.TakeScreenshot(Descriptors.NewApplication.NewScreen.NewElement, filePath);
sampleApp.TakeScreenshot(Descriptors.NewApplication.NewScreen.NewElement, filePath);
filePath
.
var fileExists = system.FileExists(filePath);
var fileExists = system.FileExists(filePath);
filePath
.
testing.VerifyAreEqual(fileExists, true);
testing.VerifyAreEqual(fileExists, true);
You can add options in your code in two ways.
Ctrl
+ Space
, and IntelliSense appears,
enabling you to browse and select your preferred overload. You might decide to
select the overload where you have the parameters set up in advance. Optional
parameters are indicated within by brackets.
windowResize
, you
can use this syntax:
var sampleApp = uiAutomation.Attach(Descriptors.NewApplication.NewScreen, windowResize: NWindowResize.Restore);
var sampleApp = uiAutomation.Attach(Descriptors.NewApplication.NewScreen, windowResize: NWindowResize.Restore);
Options
class. This offers a bit more flexibility
in customizing your parameters.
- Definition
- Overloads
TakeScreenshot(IElementDescriptor, TakeScreenshotOptions)
TakeScreenshot(IElementDescriptor, String)
TakeScreenshot(String, TakeScreenshotOptions)
TakeScreenshot(String, String)
TakeScreenshot(RuntimeTarget, TakeScreenshotOptions)
TakeScreenshot(TargetAnchorableModel, TakeScreenshotOptions)
TakeScreenshot(TargetAnchorableModel, String)
- Code example
- Adding options