Class SourceTag
- Namespace
- Ranorex
- Assembly
- Ranorex.Plugin.Web.dll
The HTML5 'source' tag.
public class SourceTag : WebElement, IAdapter
- Inheritance
-
SourceTag
- Implements
- Inherited Members
Constructors
SourceTag()
Creates a new SourceTag adapter instance. This constructor is used internally by the Ranorex Core Framework for performance issues!
protected SourceTag()
SourceTag(Element)
Creates a new SourceTag adapter instance.
public SourceTag(Element element)
Parameters
elementElementThe element to create the adapter for.
Exceptions
- NullReferenceException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
Properties
Media
The 'media' attribute of the element.
public virtual string Media { get; set; }
Property Value
Exceptions
- SetAttributeFailedException
Thrown if setting the attribute value failed.
RequiredCapabilities
Capabilities required by the adapter implementation.
protected override string[] RequiredCapabilities { get; }
Property Value
- string[]
Sizes
The 'sizes' attribute of the element.
public virtual string Sizes { get; set; }
Property Value
Exceptions
- SetAttributeFailedException
Thrown if setting the attribute value failed.
Source
The 'source' attribute of the element.
public virtual string Source { get; set; }
Property Value
Exceptions
- SetAttributeFailedException
Thrown if setting the attribute value failed.
SrcSet
The 'srcset' attribute of the element.
public virtual string SrcSet { get; set; }
Property Value
Exceptions
- SetAttributeFailedException
Thrown if setting the attribute value failed.
Title
The 'title' attribute of the element.
public virtual string Title { get; set; }
Property Value
Exceptions
- SetAttributeFailedException
Thrown if setting the attribute value failed.
Type
The 'type' attribute of the element.
public virtual string Type { get; set; }
Property Value
Exceptions
- SetAttributeFailedException
Thrown if setting the attribute value failed.
Methods
FromElement(Element)
Converts an Element to an instance of this class.
public static SourceTag FromElement(Element element)
Parameters
elementElementThe element to convert.
Returns
- SourceTag
The SourceTag.
Exceptions
- ArgumentNullException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
FromPath(string)
Converts a string to an instance of this class by searching the root.
public static SourceTag FromPath(string path)
Parameters
pathstringThe search path.
Returns
- SourceTag
The SourceTag.
Remarks
The DefaultSearchTimeout is used to search for the specified path.
Exceptions
- ArgumentNullException
If
pathisnull.- RxPathException
If the specified
pathis not valid.- ElementNotFoundException
If no element is found.
- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
Operators
implicit operator SourceTag(Element)
Implicitly converts an Element to an instance of this class.
public static implicit operator SourceTag(Element element)
Parameters
elementElementThe element to convert.
Returns
- SourceTag
The SourceTag.
Exceptions
- ArgumentNullException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
implicit operator SourceTag(string)
Implicitly converts a string to an instance of this class by searching the root.
public static implicit operator SourceTag(string path)
Parameters
pathstringThe search path.
Returns
- SourceTag
The SourceTag.
Remarks
The DefaultSearchTimeout is used to search for the specified path.
Exceptions
- ArgumentNullException
If
pathisnull.- RxPathException
If the specified
pathis not valid.- ElementNotFoundException
If no element is found.
- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.