예제 #1
0
        /// <summary>
        /// Inside each row for CompletionStatistic grid, there is the Location link.
        /// This function return the location link value.
        /// tr.td.a href="TrackTestResults.aspx?id=19504&key=789&section=False..."
        /// </summary>
        /// <param name="rowElement"></param>
        /// <returns></returns>
        private string GetLinkRefValue(WebElementWrapper rowElement, By by)
        {
            IWebElement       linkElement        = rowElement.FindElement(by);
            WebElementWrapper linkElementWrapper = new WebElementWrapper(by);

            linkElementWrapper.WrappedElement    = linkElement;
            linkElementWrapper.FakeAttributeHref = "TrackTestResults.aspx?id=19504&key=789&section=False";

            string linkReference = linkElementWrapper.GetAttribute("href");

            Report.Write("Got link reference: " + linkReference);
            return(linkReference);
        }
예제 #2
0
        private string GetUniqueId(WebElementWrapper webElement, By by)
        {
            IWebElement       statusColumn        = webElement.FindElement(by);
            WebElementWrapper statusColumnWrapper = new WebElementWrapper(by);

            statusColumnWrapper.WrappedElement  = statusColumn;
            statusColumnWrapper.FakeAttributeId = "ctl00_MainContent_TrackTestDetail_DataCollectionGridView1_gridInstitutionView_ctl03_ctl01_HyperLinkDataCollectionReport";

            string id = statusColumnWrapper.GetAttribute("id");

            Report.Write("Got the attribute: 'id' = '" + id + "' of this element by: '" + by.ToString() + "'.");
            int    from     = id.IndexOf("_ctl") + "_ctl".Length;
            int    to       = id.LastIndexOf("_");
            string index    = id.Substring(from, to - from);
            string uniqueId = "ctl" + index;

            Report.Write("uniqueId is " + uniqueId); // ctl03_ctl01
            return(uniqueId);
        }
예제 #3
0
 /// <summary>
 /// Verified the layout in test tunnel is either:
 /// One column down
 /// Two column across, then down
 /// Two column down, then across
 ///
 /// This code use the answer choice D to determine the layout. This is because only D
 /// had cssSelector path that is different for the 3 layout.
 /// </summary>
 public void VerifyLayoutInTestTunnel()
 {
     AnswerD = new WebElementWrapper(ByAnswerD);
     AnswerD.FindElement();
 }