- Overview
 - Cryptography
 - Database
 - Java
 - Python
 - WebAPI
 

Developer Activities
The following example explains how to use activities such as Deserialize XML or Execute XPath for deserializing and analyzing a XML file. You can find these activities in the UiPath.WebAPI.Activities package.
This is how the automation process can be built:
- Open Studio and create a new Process.
 - 
               
Drag a Sequence container in the Workflow Designer.
- 
                     
Create the following variables:
Variable Name
Variable Type
Default Value
SelectedProjectPathString
WorkflowXMLStringString
WorkflowXMLXDocument
ScreenshotAttributesObject
 
 - 
                     
 - 
               
Add a Select Folder activity inside the Sequence.
- In the Properties panel, add the variable 
SelectedProjectPathin the SelectedFolder field. 
 - In the Properties panel, add the variable 
 - 
               
Add a For Each activity after the Select Folder activity.
- Add the value 
WorkflowFilein the ForEach field. - Add the expression 
Directory.GetFiles(SelectedProjectPath, "*.xaml", SearchOption.AllDirectories)in the Values field. 
 - Add the value 
 - 
               
Add a Read Text File in the Body container of the For Each activity.
- Add the value 
WorkflowFilein the FileName field. - In the Properties panel, add the variable 
WorkflowXMLStringin the Content field. 
 - Add the value 
 - 
               
Add a Deserialize XML activity after the Read Text File.
- Add the variable 
WorkflowXMLStringin the XMLString field. - In the Properties panel, add the value 
WorkflowXMLin the XMLDocument field. 
 - Add the variable 
 - 
               
Add an Execute XPath activity after the Deserialize XML activity.
- Add the value 
WorkflowXMLin the Existing XML field. - Add the expression 
"//@InformativeScreenshot"in the XPath Expression field. - In the Properties panel, add the variable 
ScreenshotAttributesin the Result field. 
 - Add the value 
 - 
               
Add a For Each activity after the Execute XPath activity.
- Add the value 
Attributein the ForEach field. - Add the expression 
CType(ScreenshotAttributes, IEnumerable).Cast(Of XAttribute)in the Values field. - 
                     
Select the Body container of the activity and create the following variable:
Variable Name
Variable Type
Default Value
ScreenshotFileExistsBoolean
 
 - Add the value 
 - 
               
Add a Log Message activity inside the Body container of the For Each activity.
- Add the expression 
"Looking for: " + SelectedProjectPath + "\.screenshots\" + Attribute.Value + ".png"in the Message field. 
 - Add the expression 
 - 
               
Add a Path Exists activity after the Log Message activity.
- Select the File option from the Path File drop-down list.
 - Add the expression 
SelectedProjectPath + "\.screenshots\" + Attribute.Value + ".png"in the XPath Expression field. 
 - 
               
Add an If activity after the Path Exists activity.
- Add the expression 
Not ScreenshotFileExistsin the Condition field. 
 - Add the expression 
 - 
               
Add a Log Message activity inside the Then field of the If activity.
- Select the Warn option from the Level drop-down list.
 - 
                     Add the expression
String.Format("Could not find the screenshot file {0}.png referenced by file {1}", Attribute.Value, WorkflowFile)in the Message field. 
 - Run the process. When prompted, select the MissingScreenshotSampleProject-ForTestPurposes folder. The XML workflow file in the folder is read and deserialized. Information about screenshots referenced in the XAML is used to identify and log found and missing screenshots in the folder.
 
Here you can download an example.