Class
SettingsConfigSectionHandler

Settings object config section handler. Use this object to read a Settings config section in a .config file.

csharp
You can persist the settings for your application/test cases in a config file.

The following is a sample config file that holds certain settings. Any settings not specified in this section, their values will be set to the system defaults:

<?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="WebAii.Settings" type="ArtOfTest.WebAii.Core.SettingsConfigSectionHandler,ArtOfTest.WebAii"/> </configSections>

<WebAii.Settings defaultBrowser="InternetExplorer" logLocation="D:\Log" executionTimeout="30000" clientReadyTimeout="60000" localWebServer="None"; webAppPhysicalPath="c:\Inetpub\wwwroot\MyApplication" enableScriptLogging="false" queryEventLogErrorsOnExit="false" enableUILessRequestViewing="false" baseUrl="http://www.testsite.com/" executionDelay="0" annotateExecution="false" annotationMode="All" logAnnotations="false" simulatedMouseMoveSpeed="0.3f" waitCheckInterval="500" aspNetDevServerPort="-1" createLogFile="true" killBrowserProcessOnClose="false" killBrowsersBeforeStart="false" recycleBrowser="false" useHttpProxy="false" enableSilverlight="false" xMultiMgr="false" silverlightConnectTimeout="60000" elementWaitTimeout="15000" />

</configuration>

In your code, you can get these settings by using the SettingsConfigSectionHandler like this:

SettingsConfigSectionHandler settingsSection = (SettingsConfigSectionHandler)ConfigurationManager.GetSection("WebAii.Settings"); Settings mySettings = new Settings(settingsSection);

You can then use mySettings to pass in to the Manager constructor.

Definition

Namespace:ArtOfTest.WebAii.Core

Assembly:ArtOfTest.WebAii.dll

Syntax:

cs-api-definition
public class SettingsConfigSectionHandler : ConfigurationSection

Inheritance: objectConfigurationElementConfigurationSectionSettingsConfigSectionHandler

Inherited Members ConfigurationSection.GetRuntimeObject()ConfigurationSection.IsModified()ConfigurationSection.ResetModified()ConfigurationSection.DeserializeSection(XmlReader)ConfigurationSection.SerializeSection(ConfigurationElement, string, ConfigurationSaveMode)ConfigurationSection.ShouldSerializePropertyInTargetVersion(ConfigurationProperty, string, FrameworkName, ConfigurationElement)ConfigurationSection.ShouldSerializeElementInTargetVersion(ConfigurationElement, string, FrameworkName)ConfigurationSection.ShouldSerializeSectionInTargetVersion(FrameworkName)ConfigurationSection.SectionInformationConfigurationElement.Init()ConfigurationElement.IsReadOnly()ConfigurationElement.SetReadOnly()ConfigurationElement.ListErrors(IList)ConfigurationElement.InitializeDefault()ConfigurationElement.Reset(ConfigurationElement)ConfigurationElement.Equals(object)ConfigurationElement.GetHashCode()ConfigurationElement.SetPropertyValue(ConfigurationProperty, object, bool)ConfigurationElement.Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode)ConfigurationElement.SerializeToXmlElement(XmlWriter, string)ConfigurationElement.SerializeElement(XmlWriter, bool)ConfigurationElement.DeserializeElement(XmlReader, bool)ConfigurationElement.OnRequiredPropertyNotFound(string)ConfigurationElement.PostDeserialize()ConfigurationElement.PreSerialize(XmlWriter)ConfigurationElement.OnDeserializeUnrecognizedAttribute(string, string)ConfigurationElement.OnDeserializeUnrecognizedElement(string, XmlReader)ConfigurationElement.GetTransformedTypeString(string)ConfigurationElement.GetTransformedAssemblyString(string)ConfigurationElement.LockAttributesConfigurationElement.LockAllAttributesExceptConfigurationElement.LockElementsConfigurationElement.LockAllElementsExceptConfigurationElement.LockItemConfigurationElement.this[ConfigurationProperty]ConfigurationElement.this[string]ConfigurationElement.PropertiesConfigurationElement.ElementInformationConfigurationElement.EvaluationContextConfigurationElement.ElementPropertyConfigurationElement.HasContextConfigurationElement.CurrentConfiguration

Constructors

SettingsConfigSectionHandler()

Declaration

cs-api-definition
public SettingsConfigSectionHandler()

Properties

AnnotateExecution

Whether to enable execution highlight.

Declaration

cs-api-definition
[ConfigurationProperty("annotateExecution", IsRequired = false, DefaultValue = false)]
public bool AnnotateExecution { get; set; }

Property Value

bool

AnnotationMode

Gets the annotation mode.

Declaration

cs-api-definition
[ConfigurationProperty("annotationMode", IsRequired = false, DefaultValue = AnnotationMode.All)]
public AnnotationMode AnnotationMode { get; set; }

Property Value

AnnotationMode

ClientReadyTimeout

Gets the client ready timeout.

Declaration

cs-api-definition
[ConfigurationProperty("clientReadyTimeout", IsRequired = false, DefaultValue = 30000)]
public int ClientReadyTimeout { get; set; }

Property Value

int

CreateLogFile

Gets whether to create a log file on disk.

Declaration

cs-api-definition
[ConfigurationProperty("createLogFile", IsRequired = false, DefaultValue = true)]
public bool CreateLogFile { get; set; }

Property Value

bool

DisableDialogMonitoring

Whether to disable handling of dialog windows. Disabling dialog handling can prevent some undesirable behavior triggered by bugs in the .NET UI Automation services.

Declaration

cs-api-definition
[ConfigurationProperty("disableDialogMonitoring", IsRequired = false, DefaultValue = false)]
public bool DisableDialogMonitoring { get; set; }

Property Value

bool

ElementWaitTimeout

The global wait for elements timeout (msec) to be used during execution.

Declaration

cs-api-definition
[ConfigurationProperty("elementWaitTimeout", IsRequired = false, DefaultValue = 15000)]
public int ElementWaitTimeout { get; set; }

Property Value

int

ExecutionDelay

The execution delay set.

Declaration

cs-api-definition
[ConfigurationProperty("executionDelay", IsRequired = false, DefaultValue = 0)]
public int ExecutionDelay { get; set; }

Property Value

int

ExecutionTimeout

Gets the Execution timeout for commands.

Declaration

cs-api-definition
[ConfigurationProperty("executionTimeout", IsRequired = false, DefaultValue = 20000)]
public int ExecutionTimeout { get; set; }

Property Value

int

LogAnnotations

Gets whether to log annotations to log file.

Declaration

cs-api-definition
[ConfigurationProperty("logAnnotations", IsRequired = false, DefaultValue = false)]
public bool LogAnnotations { get; set; }

Property Value

bool

LogLocation

Gets the log location where all logging by the framework will take place.

Declaration

cs-api-definition
[ConfigurationProperty("logLocation", IsRequired = false, DefaultValue = "C:\\WebAiiLog\\")]
public string LogLocation { get; set; }

Property Value

string

QueryEventLogErrorsOnExit

If true, will query the event log for any un expected client errors.

Declaration

cs-api-definition
[ConfigurationProperty("queryEventLogErrorsOnExit", IsRequired = false, DefaultValue = false)]
public bool QueryEventLogErrorsOnExit { get; set; }

Property Value

bool

RecordingCodec

Gets the screen recording codec.

Declaration

cs-api-definition
[ConfigurationProperty("recordingCodec", IsRequired = false, DefaultValue = RecordingCodec.MJPEG)]
public RecordingCodec RecordingCodec { get; set; }

Property Value

RecordingCodec

RecordingFPS

Gets the screen recording frames per seconds.

Declaration

cs-api-definition
[ConfigurationProperty("recordingFPS", IsRequired = false, DefaultValue = 5)]
public int RecordingFPS { get; set; }

Property Value

int

RecordingMode

Gets the screen recording mode.

Declaration

cs-api-definition
[ConfigurationProperty("recordingMode", IsRequired = false, DefaultValue = RecordingMode.Off)]
public RecordingMode RecordingMode { get; set; }

Property Value

RecordingMode

RecordingOutputLocation

Gets the screen recording frames per seconds.

Declaration

cs-api-definition
[ConfigurationProperty("recordingOutputLocation", IsRequired = false, DefaultValue = "")]
public string RecordingOutputLocation { get; set; }

Property Value

string

RecordingScale

Gets the screen recording scale.

Declaration

cs-api-definition
[ConfigurationProperty("recordingScale", IsRequired = false, DefaultValue = 100)]
public int RecordingScale { get; set; }

Property Value

int

RecordingSizeLimit

Gets the screen recording file size limit

Declaration

cs-api-definition
[ConfigurationProperty("recordingSizeLimit", IsRequired = false, DefaultValue = 0)]
public int RecordingSizeLimit { get; set; }

Property Value

int

SimulatedMouseMoveSpeed

The simulated mouse move speed

Declaration

cs-api-definition
[ConfigurationProperty("simulatedMouseMoveSpeed", IsRequired = false, DefaultValue = 0.3)]
public float SimulatedMouseMoveSpeed { get; set; }

Property Value

float

TelerikComponentsVersion

The Telerik Components version to use

Declaration

cs-api-definition
[ConfigurationProperty("telerikComponentsVersion", IsRequired = false, DefaultValue = TelerikComponentsVersion.Latest)]
public TelerikComponentsVersion TelerikComponentsVersion { get; set; }

Property Value

TelerikComponentsVersion

UnexpectedDialogAction

Specifies the action to take when an unexpected dialog is encountered

Declaration

cs-api-definition
[ConfigurationProperty("unexpectedDialogAction", IsRequired = false, DefaultValue = UnexpectedDialogAction.HandleAndFailTest)]
public UnexpectedDialogAction UnexpectedDialogAction { get; set; }

Property Value

UnexpectedDialogAction

WaitCheckInterval

The global wait.Forxx interval check.

Declaration

cs-api-definition
[ConfigurationProperty("waitCheckInterval", IsRequired = false, DefaultValue = 500)]
public int WaitCheckInterval { get; set; }

Property Value

int

XMultiMgr

Enables WebAii 1.1 style connections to the browser. Added for backwards compatibility for VistaPrint doing parallel testing multiple managers.

Declaration

cs-api-definition
[ConfigurationProperty("xMultiMgr", IsRequired = false, DefaultValue = false)]
public bool XMultiMgr { get; set; }

Property Value

bool