コード例 #1
0
 public ElementVerification(Element element, int timeoutSec, bool failTest = false, bool isTrue = true)
 {
     this.element = element;
     this.timeoutSec = timeoutSec;
     this.failTest = failTest;
     this.isTrue = isTrue;
 }
コード例 #2
0
 public void Test()
 {
     driver.Navigate().GoToUrl("http://www.espn.com");
     var element = new Element("ESPN Element", By.XPath("//*[@class='espn-logo']//*[text()='ESPN']"));
     element.WaitUntil(10).Visible();
     Common.Log("Successfully navigated to " + driver.Title);
 }
コード例 #3
0
ファイル: Element.cs プロジェクト: tokarthik/ProtoTest.Golem
 /// <summary>
 /// Construct an element within an iframe
 /// </summary>
 /// <param name="name">Human readable name of the element</param>
 /// <param name="locator">By locator</param>
 public Element(string name, By locator, Element frame): base()
 {
     this._frame = frame;
     this.name = name;
     this.by = locator;
     this.pageObjectName = TestBase.GetCurrentClassName();
     this.timeoutSec = Config.Settings.runTimeSettings.ElementTimeoutSec;
 }
コード例 #4
0
 public void TestNotPresent()
 {
     driver.Navigate().GoToUrl("http://www.google.com/");
     var SearchField = new Element("SearchField", By.Name("q"));
     var element = new Element("NotPresentElement", By.Name("z"));
     SearchField.WaitUntil().Present();
     element.Verify().Not().Present();
 }
コード例 #5
0
 public void TestDSL()
 {
     driver.Navigate().GoToUrl("http://www.google.com/");
     var element = new Element("NameOfElement", By.Name("q"));
     element.SetText("ProtoTest");
     element.Verify().Value("ProtoTest").Submit();
     element.WaitUntil(20).Visible().Text = "Golem";
     element.Verify(20).Value("Golem");
 }
コード例 #6
0
 public Element SearchResult(string text)
 {
     searchResult = new Element("SearchResultLink", By.PartialLinkText(text));
     return searchResult;
 }
コード例 #7
0
ファイル: Element.cs プロジェクト: sakthijas/ProtoTest.Golem
 /// <summary>
 ///     Construct an element
 /// </summary>
 /// <param name="locator">By locator</param>
 public Element(By locator, Element frame)
 {
     _frame = frame;
     name = "Element";
     by = locator;
     pageObjectName = TestBase.GetCurrentClassName();
     timeoutSec = Config.Settings.runTimeSettings.ElementTimeoutSec;
 }
コード例 #8
0
ファイル: Element.cs プロジェクト: sakthijas/ProtoTest.Golem
 public ReadOnlyCollection<IWebElement> FindElements(Element element)
 {
     return FindElements(element.by);
 }
コード例 #9
0
ファイル: Element.cs プロジェクト: sakthijas/ProtoTest.Golem
 /// <summary>
 ///     Returns the first element found by the locator.
 /// </summary>
 /// <param name="by">The locator to use.</param>
 /// <returns>The IWebElement found.</returns>
 public IWebElement FindElement(Element childElement)
 {
     var then = DateTime.Now.AddSeconds(timeoutSec);
     for (var now = DateTime.Now; now < then; now = DateTime.Now)
     {
         try
         {
             var eles = element.FindElements(childElement.by);
             if (eles.Count > 0)
                 return new Element(eles[0], by);
             Common.Delay(1000);
         }
         catch (StaleElementReferenceException e)
         {
         }
     }
     throw new NoSuchElementException(string.Format("Element ({0}) was not present after {1} seconds",
         childElement.@by, timeoutSec));
 }
コード例 #10
0
 public void TestWithName()
 {
     var element = new Element("NameOfElement",By.Id("Id"));
     Assert.AreEqual(element.name, "NameOfElement");
 }
コード例 #11
0
 public void TestNoName()
 {
     var element = new Element(By.Id("Id"));
     Assert.AreEqual(element.name, "Element");
 }
コード例 #12
0
 public Component(Element RootElement, string name, By by) : base(name, by)
 {
     this.RootElement = RootElement;
 }
コード例 #13
0
 public Component(Element RootElement, By by) : base(by)
 {
     this.RootElement = RootElement;
 }