Exemple #1
0
        public ElementTag(string tagName, string inputTypes)
        {
            TagName        = tagName;
            IsInputElement = ElementFinder.isInputElement(tagName);

            // Check arguments
            if (IsInputElement)
            {
                if (UtilityClass.IsNullOrEmpty(inputTypes))
                {
                    throw new ArgumentNullException("inputTypes", String.Format("inputTypes must be set when tagName is '{0}'", tagName));
                }

                InputTypes = inputTypes.ToLower();
            }
        }
Exemple #2
0
 /// <summary>
 /// This constructor is mainly used from within WatiN.
 /// </summary>
 /// <param name="domContainer"><see cref="DomContainer"/> this element is located in</param>
 /// <param name="elementFinder">The element finder.</param>
 public Element(DomContainer domContainer, ElementFinder elementFinder)
 {
     init(domContainer, null, elementFinder);
 }
Exemple #3
0
 public Span(DomContainer ie, ElementFinder finder)
     : base(ie, finder)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ButtonCollection"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The DOM container.</param>
 /// <param name="finder">The finder.</param>
 /// <param name="createElementInstance">The create element instance.</param>
 public BaseElementCollection(DomContainer domContainer, ElementFinder finder, CreateElementInstance createElementInstance)
     :
     this(domContainer, (ArrayList)null, createElementInstance)
 {
     this.finder = finder;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ButtonCollection"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The DOM container.</param>
 /// <param name="finder">The finder.</param>
 /// <param name="createElementInstance">The create element instance.</param>
 public BaseElementCollection(DomContainer domContainer, ElementFinder finder, CreateElementInstance createElementInstance)
     : this(domContainer, (ArrayList)null, createElementInstance)
 {
     this.finder = finder;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RadioButtonCollection"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The DOM container.</param>
 /// <param name="finder">The finder.</param>
 public RadioButtonCollection(DomContainer domContainer, ElementFinder finder)
     : base(domContainer, finder, new CreateElementInstance(New))
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CheckBoxCollection"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The DOM container.</param>
 /// <param name="finder">The finder.</param>
 public CheckBoxCollection(DomContainer domContainer, ElementFinder finder) : base(domContainer, finder, new CreateElementInstance(New))
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SelectListCollection"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The DOM container.</param>
 /// <param name="finder">The finder.</param>
 public SelectListCollection(DomContainer domContainer, ElementFinder finder)
     : base(domContainer, finder, new CreateElementInstance(New))
 {
 }
Exemple #9
0
 public ElementsContainer(DomContainer ie, ElementFinder finder)
     : base(ie, finder)
 {
 }
Exemple #10
0
 public TextField(DomContainer ie, ElementFinder finder) : base(ie, finder)
 {
 }
Exemple #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CheckBox"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The domContainer.</param>
 /// <param name="finder">The finder.</param>
 public CheckBox(DomContainer domContainer, ElementFinder finder)
     : base(domContainer, finder)
 {
 }
Exemple #12
0
 /// <summary>
 /// Returns an instance of a SelectList object.
 /// Mainly used internally.
 /// </summary>
 /// <param name="ie">The <see cref="DomContainer"/> the element is in.</param>
 /// <param name="finder">The element finder to use.</param>
 public SelectList(DomContainer ie, ElementFinder finder) : base(ie, finder)
 {
     //Focus();
 }
Exemple #13
0
 /// <summary>
 /// Initialises a new instance of the <see cref="Button"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The <see cref="DomContainer" /> the element is in.</param>
 /// <param name="finder">The input button or button element.</param>
 public Button(DomContainer domContainer, ElementFinder finder)
     : base(domContainer, finder)
 {
 }
Exemple #14
0
 private void init(DomContainer domContainer, object element, ElementFinder elementFinder)
 {
     this.domContainer  = domContainer;
     this.element       = element;
     this.elementFinder = elementFinder;
 }
Exemple #15
0
 public Span(DomContainer ie, ElementFinder finder) : base(ie, finder)
 {
 }
Exemple #16
0
 /// <summary>
 /// This constructor is mainly used from within WatiN.
 /// </summary>
 /// <param name="domContainer"><see cref="DomContainer"/> this element is located in</param>
 /// <param name="elementFinder">The element finder.</param>
 public Element(DomContainer domContainer, ElementFinder elementFinder)
 {
     init(domContainer, null, elementFinder);
 }
Exemple #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RadioButtonCollection"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The DOM container.</param>
 /// <param name="finder">The finder.</param>
 public RadioButtonCollection(DomContainer domContainer, ElementFinder finder) : base(domContainer, finder, new CreateElementInstance(New))
 {
 }
Exemple #18
0
 private void init(DomContainer domContainer, object element, ElementFinder elementFinder)
 {
     this.domContainer = domContainer;
     this.element = element;
     this.elementFinder = elementFinder;
 }
Exemple #19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Div"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The DOM container.</param>
 /// <param name="finder">The HTML div element.</param>
 public Div(DomContainer domContainer, ElementFinder finder)
     : base(domContainer, finder)
 {
 }
 public TextField(DomContainer ie, ElementFinder finder)
     : base(ie, finder)
 {
 }
Exemple #21
0
 public RadioCheck(DomContainer ie, ElementFinder finder) : base(ie, finder)
 {
 }
 public ElementsContainer(DomContainer ie, ElementFinder finder)
     : base(ie, finder)
 {
 }
Exemple #23
0
 public RadioButton(DomContainer ie, ElementFinder finder) : base(ie, finder)
 {
 }
Exemple #24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CheckBox"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The domContainer.</param>
 /// <param name="finder">The finder.</param>
 public CheckBox(DomContainer domContainer, ElementFinder finder) : base(domContainer, finder)
 {
 }
 public RadioButton(DomContainer ie, ElementFinder finder)
     : base(ie, finder)
 {
 }
Exemple #26
0
 /// <summary>
 /// Initialises a new instance of the <see cref="Button"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The <see cref="DomContainer" /> the element is in.</param>
 /// <param name="finder">The input button or button element.</param>
 public Button(DomContainer domContainer, ElementFinder finder)
     : base(domContainer, finder)
 {
 }
 public RadioCheck(DomContainer ie, ElementFinder finder)
     : base(ie, finder)
 {
 }
 /// <summary>
 /// Returns an instance of a SelectList object.
 /// Mainly used internally.
 /// </summary>
 /// <param name="ie">The <see cref="DomContainer"/> the element is in.</param>
 /// <param name="finder">The element finder to use.</param>
 public SelectList(DomContainer ie, ElementFinder finder)
     : base(ie, finder)
 {
     //Focus();
 }
Exemple #29
0
 /// <summary>
 /// Gets the specified Button by using the given <see cref="Attribute" /> to find the Button.
 /// <seealso cref="Find" />
 /// </summary>
 /// <param name="findBy">The <see cref="Attribute"/> class or one of it's subclasses to find an element by. The <see cref="Find" /> class provides factory methodes to create specialized instances.</param>
 /// <exception cref="ElementNotFoundException">Thrown if the given <paramref name="findBy"/> doesn't match an element in the webpage.</exception>
 /// <example>
 /// This example opens a webpage, types some text and submits it by clicking
 /// the submit button.
 /// <code>
 /// using WatiN.Core;
 ///
 /// namespace NewIEExample
 /// {
 ///    public class WatiNWebsite
 ///    {
 ///      public WatiNWebsite()
 ///      {
 ///        IE ie = new IE("http://www.example.net");
 ///        Id textFieldId = new Id("textFieldComment");
 ///        ie.TextField(textFieldId).TypeText("This is a comment to submit");
 ///        ie.Button(Find.ByText("Submit")).Click;
 ///        ie.Close;
 ///      }
 ///    }
 ///  }
 /// </code>
 /// </example>
 public Button Button(Attribute findBy)
 {
     return(new Button(DomContainer, ElementFinder.ButtonFinder(findBy, this)));
 }
Exemple #30
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Div"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The DOM container.</param>
 /// <param name="finder">The HTML div element.</param>
 public Div(DomContainer domContainer, ElementFinder finder)
     : base(domContainer, finder)
 {
 }