Class ElementInfo
Represents a container for a single captured element and some additional information.
public class ElementInfo
- Inheritance
-
ElementInfo
- Inherited Members
Constructors
ElementInfo(Element, RxPath, RxPath, Image, string, Guid)
Initializes a new instance of the ElementInfo class.
public ElementInfo(Element capturedElement, RxPath path, RxPath robustPath, Image screenshot, string sourceName, Guid id)
Parameters
capturedElementElementA snapshot of an element.
pathRxPathThe path of the element.
robustPathRxPathThe robust path of the element.
screenshotImageAn screenshot of the element's UI representation (can be null).
sourceNamestringA logical name of the source which created the element info.
idGuidA unique id for identifying the element info.
ElementInfo(Element, RxPath, Image, string, Guid)
Initializes a new instance of the ElementInfo class.
public ElementInfo(Element capturedElement, RxPath path, Image screenshot, string sourceName, Guid id)
Parameters
capturedElementElementA snapshot of an element.
pathRxPathThe path of the element.
screenshotImageAn screenshot of the element's UI representation (can be null).
sourceNamestringA logical name of the source which created the element info.
idGuidA unique id for identifying the element info.
Properties
Element
The snapshot of the element contained in the element info.
public Element Element { get; set; }
Property Value
- Element
An element snapshot.
Id
Gets or sets the unique identifier for the element info.
public Guid Id { get; set; }
Property Value
- Guid
The Guid.
LiveElementOrSnapshot
The live reference element if available, otherwhise the clone of the element contained in the element info.
public Element LiveElementOrSnapshot { get; }
Property Value
- Element
The element.
LiveReferenceElement
The instance of the live element this element info was created from.
public Element LiveReferenceElement { get; set; }
Property Value
- Element
The live reference element.
Remarks
This is not persisted, and is allowed to be null.
Parent
Gets or sets the parent of this instance.
public ElementInfo Parent { get; }
Property Value
- ElementInfo
The parent of this instance.
Path
The path of the element contained in the element info.
public RxPath Path { get; set; }
Property Value
- RxPath
The path.
PathElementMap
Gets the path element map.
public IDictionary<RxPath, ElementInfo> PathElementMap { get; }
Property Value
- IDictionary<RxPath, ElementInfo>
The path element map.
ReferenceImage
A bitmap for reference information (not for image-based, but for reference screenshots)
public Bitmap ReferenceImage { get; set; }
Property Value
ReferencePath
The full-length reference path if the path was built with StepCostReduce, null otherwise
public string ReferencePath { get; set; }
Property Value
RelativePath
The relative path of the element contained in the element info, if a root element was specified when creating the ElementInfo.
public RxPath RelativePath { get; }
Property Value
- RxPath
The relative path.
RobustPath
The robust path of the element contained in the element info.
public RxPath RobustPath { get; set; }
Property Value
- RxPath
The robust path.
ScreenShot
Gets or sets the screen shot of the element.
public CompressedImage ScreenShot { get; set; }
Property Value
- CompressedImage
The screen shot.
SourceName
The logical name of the source which created this element info.
public string SourceName { get; set; }
Property Value
- string
The name of the source.
Methods
Clone()
Creates a deep clone of the ElementInfo instance.
public ElementInfo Clone()
Returns
- ElementInfo
The cloned instance.
Create(Element, Element, RxPath, string, bool, bool, string, bool)
Creates a new element info given an element and a path.
public static ElementInfo Create(Element target, Element rootElement, RxPath path, string refPath, bool captureImage, bool captureLineage, string sourceName, bool includeDynamicAttributeValues)
Parameters
targetElementThe target element to create the info from.
rootElementElementThe root element to create an additonal relative path to the target.
pathRxPathThe already constructed element path.
refPathstringThe reference path for the element. Can be null.
captureImageboolSpecifies whether to capture a screenshot for the element.
captureLineageboolif set to
truealso capture all parents.sourceNamestringAn arbitrary source name.
includeDynamicAttributeValuesboolSpecifies whether to include values from dynamic attributes in the Element snapshot.
Returns
- ElementInfo
The created ElementInfo.
Create(Element, RxPath, string, bool, bool, string)
Creates a new element info given an element and a path.
public static ElementInfo Create(Element target, RxPath path, string refPath, bool captureImage, bool captureLineage, string sourceName)
Parameters
targetElementThe target element to create the info from.
pathRxPathThe already constructed element path.
refPathstringThe reference path for the element. Can be null.
captureImageboolSpecifies whether to capture a screenshot for the element.
captureLineageboolif set to
truealso capture all parents.sourceNamestringAn arbitrary source name.
Returns
- ElementInfo
The created ElementInfo.
Create(Element, RxPath, string, bool, bool, string, bool)
Creates a new element info given an element and a path.
public static ElementInfo Create(Element target, RxPath path, string refPath, bool captureImage, bool captureLineage, string sourceName, bool includeDynamicAttributeValues)
Parameters
targetElementThe target element to create the info from.
pathRxPathThe already constructed element path.
refPathstringThe reference path for the element. Can be null.
captureImageboolSpecifies whether to capture a screenshot for the element.
captureLineageboolif set to
truealso capture all parents.sourceNamestringAn arbitrary source name.
includeDynamicAttributeValuesboolSpecifies whether to include values from dynamic attributes in the Element snapshot.
Returns
- ElementInfo
The created ElementInfo.
Create(Element, bool, bool, string)
Creates a new element info from a given element.
public static ElementInfo Create(Element target, bool captureImage, bool captureLineage, string sourceName)
Parameters
targetElementThe target element to create the info from.
captureImageboolSet to true if an image should be captured.
captureLineageboolif set to
truealso capture all parents.sourceNamestringAn arbitrary source name.
Returns
- ElementInfo
The created ElementInfo.