static void Main(string[] args)
        {
            Tag     html  = new HtmlTag();
            Tag     body  = new BodyTag();
            Tag     head  = new HeadTag();
            Tag     title = new TitleTag();
            Tag     div   = new DivTag();
            Element elem1 = new Element();
            Element elem2 = new Element();
            Element elem3 = new Element();
            Tag     brr   = new BrTag();

            Tag h1 = new H1Tag();

            elem1.SetContent("titlu");
            elem2.SetContent("giele");
            elem3.SetContent("gielesss");
            html.AddTag(head);
            html.AddTag(body);
            head.AddElement(elem1);
            head.AddTag(brr);
            head.AddTag(title);
            head.AddElement(elem2);
            head.AddTag(title);
            head.AddElement(elem3);
            body.AddTag(div);
            div.AddTag(h1);
            div.AddAttribute("color", "blue");
            div.AddAttribute("color1", "red");
            //title.SetContent("Gigi 4 the WIN!!");
            //head.SetContent("gigel");
            //html.Render();
            Parser.ParseFile("index.html");
        }
示例#2
0
        public void VerifyClcid()
        {
            driver.Url = "https://dynamics.microsoft.com/en-us/";
            List <IWebElement> H1Tags = driver.FindElements(By.TagName("a")).ToList();

            foreach (IWebElement H1Tag in H1Tags)
            {
                if (H1Tag.GetAttribute("href").Contains("https://go.microsoft.com/fwlink/"))
                {
                    string value;
                    value = H1Tag.GetAttribute("href");
                    Assert.IsTrue(value.Contains("clcid"), value);
                }
            }
        }
示例#3
0
        public static void CheckArticleOnContentPanel(string catname, string arname)
        {
            DHSTranslateReader          reader     = new DHSTranslateReader();
            Dictionary <string, Object> categories = reader.GetCategories();
            Dictionary <string, Object> category   = (Dictionary <string, Object>)categories[catname];
            string cattitle = (String)category["title"];

            Dictionary <string, Object> articles = (Dictionary <string, Object>)category["articles"];
            // check article title
            Dictionary <string, Object> article = (Dictionary <string, Object>)articles[arname];
            string artitle = (String)article["title"];

            System.Console.WriteLine("Article: " + artitle);

            Dictionary <string, Object> content = (Dictionary <string, Object>)article["content"];
            string header = (String)content["header"];

            System.Console.WriteLine("Header: " + header);

            // get actual header
            H1Tag arHeader = Host.Local.FindSingle <H1Tag>(@"/dom//div[#'ArticleBody']//h1");

            arHeader.Click();
            Delay.Milliseconds(1000);
            string arHeaderText = arHeader.InnerText;

            Report.Log((arHeaderText == header)?ReportLevel.Success:ReportLevel.Failure,
                       "Check Article title on Content Area: expected text is: \"" + header + "\" and actuall text is: \"" + arHeaderText + "\"");
            // check verticle scroll bar is shown if article content spread more than 1 page
            try{
                Ranorex.WebElement invisibleElement = Host.Local.FindSingle <Ranorex.WebElement>(@"/dom//div[#'ArticleBody']//*[@visible='False']", 10000);
                CheckVerticleScrollBar(true);
            }
            catch (ElementNotFoundException ex) {
                CheckVerticleScrollBar(false);
            }

            string networkStatus = repo.Taskbar.NetwordIcon.GetAttributeValue <String>("Text");

            Delay.Milliseconds(5000);
            if (networkStatus.Contains("access"))
            {
                // check article language
                Report.Log(ReportLevel.Info, "Check article language when connect network!");
                CheckArticleLanguage(artitle);
            }
        }