當前位置: 首頁>>代碼示例>>C#>>正文


C# IE.ContainsText方法代碼示例

本文整理匯總了C#中WatiN.Core.IE.ContainsText方法的典型用法代碼示例。如果您正苦於以下問題:C# IE.ContainsText方法的具體用法?C# IE.ContainsText怎麽用?C# IE.ContainsText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WatiN.Core.IE的用法示例。


在下文中一共展示了IE.ContainsText方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Should_save_a_visit

        public void Should_save_a_visit()
        {
            new DatabaseTester().Clean();

            var url = "http://localhost:1234/";
            using (var ie = new IE(url))
            {
                ie.TextField("PathAndQuerystring").TypeText("/MyUrl");
                ie.TextField("LoginName").TypeText("SomeComputer\\ThisUser");
                ie.Button("submit").Click();

                ie.ContainsText("/MyUrl");
                ie.ContainsText("SomeComputer\\ThisUser").ShouldBeTrue();
            }
        }
開發者ID:jbasilio,項目名稱:IterationZero,代碼行數:15,代碼來源:HomeControllerTester.cs

示例2: Page_With_An_Action

        public void Page_With_An_Action()
        {
            using (var browser = new IE("http://www.google.com")) {
                browser.Page<GoogleSearchPage>().SearchFor("Robby");

                Assert.IsTrue(browser.ContainsText("Robby"));
            }
        }
開發者ID:robbytarigan,項目名稱:HelloWorldWatin,代碼行數:8,代碼來源:UnitTest1.cs

示例3: Verify_WebsiteUp

 public void Verify_WebsiteUp()
 {
     using (var browser = new IE("http://localhost/Sample.Web_deploy"))
     {
         var hasText = browser.ContainsText("Getting started");
         Assert.IsTrue(hasText);
     }
 }
開發者ID:jiffypopjr,項目名稱:JoshLocal,代碼行數:8,代碼來源:UnitTest1.cs

示例4: Home_HasMvcStoreHasTitle_True

        public void Home_HasMvcStoreHasTitle_True()
        {
            var browser = new IE("http://localhost:1100/");

            browser.BringToFront();
            Assert.IsTrue(browser.ContainsText("ASP.NET MVC MUSIC STORE"));

            browser.Close();
        }
開發者ID:giozom,項目名稱:ODNC-WatiN-And-SpecFlow-Demo-Code,代碼行數:9,代碼來源:HomeTests.cs

示例5: GenerateNummericSequenceUITest

        public void GenerateNummericSequenceUITest()
        {
                       
            using (var browser = new IE("http://localhost:10827/"))
            {
                browser.TextField(Find.ByName("txtNumber")).TypeText("15");
                browser.Button(Find.ByName("btnGenerate")).Click();
                Assert.IsTrue(browser.ContainsText("All Numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 "));
                Assert.IsTrue(browser.ContainsText("All Odd Numbers: 1, 3, 5, 7, 9, 11, 13, 15 "));
                Assert.IsTrue(browser.ContainsText("All Even Numbers: 0, 2, 4, 6, 8, 10, 12, 14 "));
                Assert.IsTrue(browser.ContainsText("All Extended FizzBuzzs: Z, 1, 2, C, 4, E, C, 7, 8, C, E, 11, C, 13, 14, Z "));
                Assert.IsTrue(browser.ContainsText("All Fibonacci Numbers: 0, 1, 1, 2, 3, 5, 8, 13 "));

                System.Threading.Thread.Sleep(5000);

            }
            
        }
開發者ID:navingautam,項目名稱:WorldNomad.NumericSequence,代碼行數:18,代碼來源:NumericSequenceIndexPageTest.cs

示例6: AddPost_ShouldRenderAddForm_AndConfirmPostSaved

        public void AddPost_ShouldRenderAddForm_AndConfirmPostSaved()
        {
            using(IE browser = new IE(BuildTestUrl("post/add.aspx")))
            {
                Assert.IsTrue(browser.ContainsText("Ben Lovell's Blog"),
                    "No header text found");
                Assert.IsTrue(browser.ContainsText("Add Post"),
                    "Add Post not found");

                browser.TextField(Find.ByName("post.Title")).TypeText("Title");
                browser.TextField(Find.ByName("post.Description")).TypeText("Description");
                browser.TextField(Find.ByName("post.Content")).TypeText("Content");
                browser.Button(Find.ByValue("Submit")).Click();

                Assert.IsTrue(browser.ContainsText(@"The post titled: 'Title' was created!"),
                    "Correct confirmation was not displayed");
            }
        }
開發者ID:nshah55,項目名稱:mr-blogengine,代碼行數:18,代碼來源:AddPostFixture.cs

示例7: Save_should_fail_when_GET_attempted

 public void Save_should_fail_when_GET_attempted()
 {
     using (IE browser = new IE(BuildTestUrl("post/save.aspx")))
     {
         Assert.IsTrue(browser.ContainsText(
             @"Access to the action [save] on controller [post] is not allowed to the http verb [GET]."),
             "Action accessible via GET");
     }
 }
開發者ID:nshah55,項目名稱:mr-blogengine,代碼行數:9,代碼來源:AddPostFixture.cs

示例8: SearchForWatiNOnGoogle

        public void SearchForWatiNOnGoogle()
        {
            using (var browser = new IE("http://www.google.com")) {
                browser.TextField(Find.ByName("q")).TypeText("WatiN");
                browser.Button(Find.ByName("btnG")).Click();

                Assert.IsTrue(browser.ContainsText("WatiN"));
            }
        }
開發者ID:robbytarigan,項目名稱:HelloWorldWatin,代碼行數:9,代碼來源:UnitTest1.cs

示例9: HelloWatin

        public void HelloWatin(string search)
        {
            using (var browser = new IE("http://www.google.com"))
            {
                browser.TextField(Find.ByName("q")).TypeText(search);
                browser.Button(Find.ByName("btnG")).Click();

                Assert.IsTrue(browser.ContainsText(search));
            }
        }
開發者ID:Redabenmeradi,項目名稱:cuke4ninja,代碼行數:10,代碼來源:SmokeTestSteps.cs

示例10: RunSmokeTest

 public void RunSmokeTest()
 {
     using (var browser = new IE("http://www.google.com"))
     {
         const string search = "WatiN";
         browser.TextField(Find.ByName("q")).TypeText(search);
         browser.Button(Find.ByName("btnG")).Click();
         Assert.IsTrue(browser.ContainsText(search));
     }
 } 
開發者ID:Redabenmeradi,項目名稱:cuke4ninja,代碼行數:10,代碼來源:SmokeTest.cs

示例11: Demonstrate_speed

        public void Demonstrate_speed()
        {
            new DatabaseTester().Clean();

            var url = "http://localhost:1234/";
            using (var ie = new IE(url))
            {
                for (int i = 0; i < 50; i++)
                {
                    ie.GoTo("http://localhost:1234/");
                    ie.TextField("PathAndQuerystring").Value = "/MyUrl";
                    ie.TextField("LoginName").Value = "SomeComputer\\ThisUser";
                    ie.Button("submit").Click();

                    ie.ContainsText("/MyUrl");
                    ie.ContainsText("SomeComputer\\ThisUser").ShouldBeTrue();
                }
                
            }
        }
開發者ID:jbasilio,項目名稱:IterationZero,代碼行數:20,代碼來源:HomeControllerTester.cs

示例12: Search_for_watin_on_google_using_page_class

        public void Search_for_watin_on_google_using_page_class()
        {
            using (var browser = new IE("http://www.google.com"))
            {
                var searchPage = browser.Page<GoogleSearchPage>();
                searchPage.SearchCriteria.TypeText("WatiN");
                searchPage.SearchButton.Click();

                Assert.IsTrue(browser.ContainsText("WatiN"));
            }
        }
開發者ID:exaphaser,項目名稱:WatiN,代碼行數:11,代碼來源:GoogleTests.cs

示例13: Home_ClickOnRockContainsRockAlbumText_True

        public void Home_ClickOnRockContainsRockAlbumText_True()
        {
            using (var browser = new IE("http://localhost:1100/"))
            {

                browser.BringToFront();

                browser.Link(Find.ByText("Rockssss")).Click();
                Assert.IsTrue(browser.ContainsText("Rock Albums"));

            }
        }
開發者ID:giozom,項目名稱:ODNC-WatiN-And-SpecFlow-Demo-Code,代碼行數:12,代碼來源:HomeTests.cs

示例14: StressThread

        void StressThread()
        {
            //Settings.WaitForCompleteTimeOut = 3600;
            //Settings.WaitUntilExistsTimeOut = 3600;
            
            using (IE ie = new IE("http://localhost:8888/"))
            {
                //ie.Frame(Find.ById("uploadManager")).FileUpload(Find.ById("test")).Set("e:\\downloads\\VS7.1sp1-KB918007-X86.exe");
                //ie.Frame(Find.ById("uploadManager")).FileUpload(Find.ById("test")).Set("e:\\downloads\\Sandcastle.msi");
                SetFileUpload(ie, "slickUpload_selector_html_file0", @"C:\Users\Chris\Downloads\Firefox Setup 7.0.exe");

                //_waitEvent.WaitOne();
                ie.Link(Find.ById("uploadButton")).Click();

                while (!ie.ContainsText("Upload Result"))
                {
                    Thread.Sleep(1000);
                    //ie.WaitForComplete();
                }

                Assert.True(ie.ContainsText("Complete"));

                ie.Link(Find.ById("newUploadButton")).Click();
                ie.WaitForComplete();

                SetFileUpload(ie, "slickUpload_selector_html_file0", @"C:\Users\Chris\Downloads\SlickUpload-6.1-S3MetadataFix.zip");
                SetFileUpload(ie, "slickUpload_selector_html_file1", @"C:\Users\Chris\Downloads\MSBuild Extension Pack April 2011 (All Files) (1).zip");
                ie.Link(Find.ById("uploadButton")).Click();

                while (!ie.ContainsText("Upload Result"))
                {
                    Thread.Sleep(1000);
                    //ie.WaitForComplete();
                }

                Assert.True(ie.ContainsText("Complete"));

                //Thread.Sleep(10000);
            }
        }
開發者ID:codingbat,項目名稱:BandCamp,代碼行數:40,代碼來源:WebStressTest.cs

示例15: WpLoadingTest

        public void WpLoadingTest()
        {
            using (var browser = new IE("http://www.google.com"))
            {
                browser.TextField(Find.ByName("q")).TypeText("WatiN");
                browser.Button(Find.ByName("btnG")).Click();

                var waitForWithAssert = new WaitForPage(() =>
                {
                    Assert.IsTrue(browser.ContainsText("WatiN"));
                });
            }
        }
開發者ID:jacekmlynek,項目名稱:WebFormsSendbox,代碼行數:13,代碼來源:WatiNSampleTestscs.cs


注:本文中的WatiN.Core.IE.ContainsText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。