当前位置: 首页>>代码示例>>C#>>正文


C# ISelenium.WaitForPageToLoad方法代码示例

本文整理汇总了C#中ISelenium.WaitForPageToLoad方法的典型用法代码示例。如果您正苦于以下问题:C# ISelenium.WaitForPageToLoad方法的具体用法?C# ISelenium.WaitForPageToLoad怎么用?C# ISelenium.WaitForPageToLoad使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISelenium的用法示例。


在下文中一共展示了ISelenium.WaitForPageToLoad方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Init

        public void Init()
        {
            //Deleting cookies in ie browser through command line.
            /*var procStartInfo = new System.Diagnostics.ProcessStartInfo("cmd", "/c RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2");
            var proc = new System.Diagnostics.Process { StartInfo = procStartInfo };
            proc.Start();
            WebDriverObj = new InternetExplorerDriver();
            */
            string URL = "https://stg-gib.ladbrokes.com/admin";
            WebDriverObj = new FirefoxDriver();
            MyBrowser = new WebDriverBackedSelenium(WebDriverObj, URL);
            MyBrowser.Start();
            WebDriverObj.Manage().Window.Maximize();
            MyBrowser.WindowMaximize();

            MyBrowser.Open(URL);
            MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
            MyBrowser.Refresh();
            MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
            MyBrowser.Type(TestDataCreation.ControlsRepository.UsrNmeTxtBx, "Automation1");
            MyBrowser.Type(TestDataCreation.ControlsRepository.PwdTxtBx, "aditi123");
            MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
            MyBrowser.Click(TestDataCreation.ControlsRepository.LoginBtn);
            MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
        }
开发者ID:hemap,项目名称:PhoenixAutomationRepo,代码行数:25,代码来源:TestDataBase.cs

示例2: SetupClass

        public void SetupClass()
        {
            base.StartServer();
            selenium = new DefaultSelenium("localhost", 4444, "*chrome", ConfigurationManager.AppSettings["baseUrl"]);
            selenium.Start();
            verificationErrors = new StringBuilder();

            selenium.DeleteAllVisibleCookies();

            selenium.Open("/dna/mbfood/");
            // To Do
            // too general, could crash test if a topic happened to have the wrong name 
            Assert.IsFalse(selenium.IsTextPresent("error"));
            Assert.IsFalse(selenium.IsTextPresent("There has been a problem"));

            selenium.Click("link=Sign in");
            selenium.Click("bbcid_username");
            selenium.Type("bbcid_username", "mpgsuper");
            selenium.Type("bbcid_password", "ratbags");
            selenium.Click("signin");
            selenium.WaitForPageToLoad("30000");

            // going this way so as to be certain to get the right site options without thinking about it
            selenium.Click("link=Site Options");
            selenium.WaitForPageToLoad("30000");

            // check a) where we are b) BBC site requirements for page titles https://confluence.dev.bbc.co.uk/display/DNA/Meta+Data - note that this title breaks those guidelines
            Assert.AreEqual("BBC - Food - DNA Administration - Site Options - Food", selenium.GetTitle());
            Assert.IsTrue(selenium.IsElementPresent("//input[@name='sov_49_General_CustomBarlesquePath']");

            stateOfOption = selenium.GetValue("//input[@name='so_49_General_CustomBarlesquePath' and @type='radio' and @checked='']/@value");
            valueOfOption = selenium.GetValue("//input[@name='so_49_General_CustomBarlesquePath' and @type='text']");
        }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:33,代码来源:CustomBarlesque.cs

示例3: Login

        public void Login()
        {
            selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://127.0.0.1:1556/");
            selenium.Start();

            selenium.Open("/");
            selenium.Type("id=loginUsername", "lex");
            selenium.Type("id=loginPassword", "lex");
            selenium.Click("//div[@id='logindisplay']/form[2]/input[3]");
            selenium.WaitForPageToLoad("30000");
            selenium.Click("//a[contains(@href, 'UserActivity/Index')]");
            selenium.WaitForPageToLoad("30000");
        }
开发者ID:supermuk,项目名称:iudico,代码行数:13,代码来源:SecuritySeleniumTester.cs

示例4: Init

 public void Init()
 {
     FfDriver = new FirefoxDriver();
     MyBrowser = new WebDriverBackedSelenium(FfDriver, "https://stg-gib.ladbrokes.com/admin");
     MyBrowser.Start();
     MyBrowser.Open("https://stg-gib.ladbrokes.com/admin");
     MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
     MyBrowser.Type(AdminSuite.CommonControls.AdminHomePage.UsrNmeTxtBx, "sanjeeva_p");
     MyBrowser.Type(AdminSuite.CommonControls.AdminHomePage.PwdTxtBx, "123456");
     MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
     MyBrowser.Click(AdminSuite.CommonControls.AdminHomePage.LoginBtn);
     MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
 }
开发者ID:hemap,项目名称:PhoenixAutomationRepo,代码行数:13,代码来源:AdminBase.cs

示例5: Login

        public void Login()
        {
            selenium = new DefaultSelenium("localhost", 4444, "*chrome", ConfigurationManager.AppSettings["SELENIUM_URL"]);
            selenium.Start();

            selenium.Open("/");
            selenium.Type("id=loginUsername", "prof");
            selenium.Type("id=loginPassword", "prof");
            selenium.Click("//div[@id='logindisplay']/form[2]/input[3]");
            selenium.WaitForPageToLoad("40000");
            selenium.Click("link=Courses");
            selenium.WaitForPageToLoad("40000");
        }
开发者ID:supermuk,项目名称:iudico,代码行数:13,代码来源:StudentRole.cs

示例6: Login

        public void Login()
        {
            selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://127.0.0.1:1556/");
            selenium.Start();

            selenium.Open("/");
            selenium.Type("id=loginUsername", "prof");
            selenium.Type("id=loginPassword", "prof");
            selenium.Click("//div[@id='logindisplay']/form[2]/input[3]");
            selenium.WaitForPageToLoad("30000");
            selenium.Click("link=Courses");
            selenium.WaitForPageToLoad("30000");
        }
开发者ID:supermuk,项目名称:iudico,代码行数:13,代码来源:StudentRole.cs

示例7: Login

        public void Login()
        {
            selenium = new DefaultSelenium("localhost", 4444, "*chrome", ConfigurationManager.AppSettings["SELENIUM_URL"]);
                selenium.Start();

            selenium.Open("/");
            selenium.Type("id=loginUsername", "lex");
            selenium.Type("id=loginPassword", "lex");
            selenium.Click("//div[@id='logindisplay']/form[2]/input[3]");
            selenium.WaitForPageToLoad("30000");
            selenium.Click("//a[contains(@href, 'UserActivity/Index')]");
            selenium.WaitForPageToLoad("30000");
        }
开发者ID:supermuk,项目名称:iudico,代码行数:13,代码来源:SecuritySeleniumTester.cs

示例8: SetupTest

        public void SetupTest()
        {
            selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://127.0.0.1:1556/");
            selenium.Start();
            verificationErrors = new StringBuilder();

            selenium.Open("/");
			selenium.Type("id=loginPassword", "lex");
			selenium.Type("id=loginUsername", "lex");
            selenium.Click("//div[@id='logindisplay']/form[2]/input[3]");
            selenium.WaitForPageToLoad("30000");
        }
开发者ID:supermuk,项目名称:iudico,代码行数:12,代码来源:UniqueUserId.cs

示例9: Google_For_SimpleTalk

        public void Google_For_SimpleTalk(SeleniumProvider seleniumProvider)
        {
            Browser = seleniumProvider.GetBrowser();

            Browser.Open("/");
            Browser.Type("q", "Simple Talk");
            Browser.Click("btnG");

            Browser.WaitForPageToLoad("3000");

            Assert.True(Browser.IsTextPresent("www.simple-talk.com"));
        }
开发者ID:benadderson,项目名称:xUnitBrowserTheoriesForSelenium,代码行数:12,代码来源:Example.cs

示例10: TestMethod3

 public void TestMethod3()
 {
     string URL = "http://www.abb.com";
     selenium = new DefaultSelenium("localhost", 4444, "*firefox", URL);
     selenium.Start();
     selenium.Open("/");
     Assert.AreEqual("The ABB Group - Automation and Power Technologies", selenium.GetTitle());
     selenium.Type("searchInput", "Robot");
     selenium.Click("search");
     selenium.WaitForPageToLoad("10000");
     Assert.AreEqual("The ABB Group", selenium.GetTitle());
     Assert.AreEqual("Robot", selenium.GetValue("searchInput"));
 }
开发者ID:shivanisharma,项目名称:test,代码行数:13,代码来源:UnitTest1.cs

示例11: TestMethod1

        public void TestMethod1()
        {
            selenium = new DefaultSelenium("localhost", 4444, "*iexplore", "http://www.google.com/");
            selenium.Start();

            selenium.Open("/");
            selenium.Type("q", "selenium rc");
            selenium.Click("btnG");
            selenium.WaitForPageToLoad("30000");
            Assert.AreEqual("selenium rc - Google Search", selenium.GetTitle());

            try
            {
                selenium.Stop();
            }
            catch (Exception)
            {
                // Ignore errors if unable to close the browser
            }
        }
开发者ID:shivanisharma,项目名称:test,代码行数:20,代码来源:UnitTest1.cs

示例12: TestMethod2

        public void TestMethod2()
        {
            selenium = new DefaultSelenium("localhost", 4444, "*iexplore", "http://localhost:1987");
            selenium.Start();
            selenium.Open("/WebSite1/");
            selenium.Type("MainContent_TextBox1", "HUM");
            selenium.Click("MainContent_Button1");
            selenium.WaitForPageToLoad("3000770");

            //Get the Table Value of Row 1 and Coulumn 2
            object GG = selenium.GetTable("MainContent_GridView1.1.2");

            Assert.AreEqual("1", "1");
            try
            {
                selenium.Stop();
            }
            catch (Exception)
            {
                // Ignore errors if unable to close the browser
            }
        }
开发者ID:shivanisharma,项目名称:test,代码行数:22,代码来源:UnitTest1.cs

示例13: AgeVerification

        /// <summary>
        /// Adding a Reward Adhoc token to customer in Admin.
        /// </summary>
        /// Date Created:
        /// Author: Anand C
        /// User should be login to Admin application
        /// <param name="adminBrowser">Browser Instance</param>
        /// <param name="custName">Customer name for whom the token be added</param>
        /// <param name="tokenVal">token value to be added</param>
        public bool AgeVerification(ISelenium adminBrowser, string cardNum, string issueNum, string CustomerName)
        {
            try
            {
                Framework.Common.Common FrameWKCommon = new Framework.Common.Common();
                //Click on Customer Verification button
                if (!AdminTableObjects(adminBrowser, "Customer attributes", "", "Button", "Customer Verification", 1))
                {
                    Framework.BaseTest.CaptureScreenshot(adminBrowser, "");
                    Console.WriteLine("Unable to click on Customer Verification button in Customer attributes table");
                    return false;
                }

                Assert.IsTrue(adminBrowser.IsElementPresent(AdminSuite.CommonControls.AdminHomePage.custVerifyCountry), "Unable to find country select box in customer verify page");
                Assert.IsTrue(adminBrowser.IsElementPresent("//input[@type='radio' and @value = 'A']"), "Unable to find country select box in customer verify page");

                adminBrowser.Click("//input[@type='radio' and @value = 'A']");

                //Entering value in OVS Score: Text box in Customer verification page
                if (!AdminTableObjects(adminBrowser, "Manually Verify Customer", "OVS Score", "Text Box", "100", 1))
                {
                    Framework.BaseTest.CaptureScreenshot(adminBrowser, "");
                    Console.WriteLine("Unable to put value in OVS Score Text box in Manually Verify Customer page");
                    return false;
                }

                //Entering value in Reference: Text box in Customer verification page
                if (!AdminTableObjects(adminBrowser, "Manually Verify Customer", "Reference", "Text Box", "100", 1))
                {
                    Framework.BaseTest.CaptureScreenshot(adminBrowser, "");
                    Console.WriteLine("Unable to put value in Reference Text box in Manually Verify Customer page");
                    return false;
                }

                //Entering value in Notes Text box in Customer verification page
                if (!AdminTableObjects(adminBrowser, "Manually Verify Customer", "Notes", "Text Box", "Notes", 1))
                {
                    Framework.BaseTest.CaptureScreenshot(adminBrowser, "");
                    Console.WriteLine("Unable to put value in Notes Text box in Manually Verify Customer page");
                    return false;
                }

                Assert.IsTrue(adminBrowser.IsElementPresent("//input[@type='radio' and @value = 'A']"), "Unable to find country select box in customer verify page");
                adminBrowser.Click("//input[@type='radio' and @value = 'A']");

                //Entering value in Driving Licence No Text box in Customer verification page
                if (!AdminTableObjects(adminBrowser, "Manually Verify Customer", "Driving Licence No", "Text Box", "Notes", 1))
                {
                    Framework.BaseTest.CaptureScreenshot(adminBrowser, "");
                    Console.WriteLine("Unable to put value in Driving Licence No Text box in Manually Verify Customer page");
                    return false;
                }

                //Click on Add Payment Method button
                if (!AdminTableObjects(adminBrowser, "Add payment method", "", "Button", "Add Payment Method", 1))
                {
                    Framework.BaseTest.CaptureScreenshot(adminBrowser, "");
                    Console.WriteLine("Unable click on Add Payment Method button in New Payment Method page");
                    return false;
                }

                adminBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
                Thread.Sleep(5000);
                Console.WriteLine("Successfully added payment method for customer");
                return true;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Framework.BaseTest.CaptureScreenshot(adminBrowser, "");
                return false;
            }
        }
开发者ID:hemap,项目名称:PhoenixAutomationRepo,代码行数:82,代码来源:Common.cs

示例14: AdminTableButtonLink

 /// <summary>
 /// Clicking on the link or button in the table
 /// </summary>
 /// Author: Anand
 /// <param name="adminBrowser">browser object</param>
 /// <param name="tableHeading">Table Heading</param>
 /// <param name="searchText">row string to be searched</param>
 /// <param name="objName">Object Type you wanted to operate on</param>
 /// <param name="objValue">Any value you would want to enter or select</param>
 /// <param name="index">column number</param>
 /// <returns> true/false</returns>
 /// Created Date: 07-June-2012
 public bool AdminTableButtonLink(ISelenium adminBrowser, string tableHeading, string searchText, string objName, string objValue, int index)
 {
     try
     {
         if (objName.Contains("Link"))
         {
             //Click on the link without a search string
             if (string.IsNullOrEmpty(searchText))
             {
                 adminBrowser.Click("//table//th[contains(string(),'" + tableHeading + "')]//ancestor::table/tbody//a[contains(text(),'" + objValue + "']");
             }
             //Click on the link with a search string
             else
             {
                 adminBrowser.Click("//table//th[contains(string(),'" + tableHeading + "')]//ancestor::table//td[contains(text(),'" + searchText + "')]/following-sibling::td/a");
             }
             _frameworkCommon.WaitUntilAllElementsLoad(adminBrowser);
             adminBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
         }
         //Click on the button
         else
         {
             adminBrowser.Click("//table//th[contains(string(),'" + tableHeading + "')]//ancestor::table/tbody//input[@value='" + objValue + "']");
             _frameworkCommon.WaitUntilAllElementsLoad(adminBrowser);
             adminBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
         }
         return true;
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         Console.WriteLine(ex.StackTrace);
         return false;
     }
 }
开发者ID:hemap,项目名称:PhoenixAutomationRepo,代码行数:47,代码来源:Common.cs

示例15: AdminSearchCustomer

        public bool AdminSearchCustomer(ISelenium adminBrowser, string custName)
        {
            try
            {
                ///Click on Customers link in Admin LHN
                if (AdminLHNClick("Customers", adminBrowser))
                {
                    Console.WriteLine("Successfully clicked on the Admin LHN link Customers");
                    adminBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
                }
                else
                {
                    Framework.BaseTest.CaptureScreenshot(adminBrowser, "");
                    Console.WriteLine("Unable to click on the Admin LHN link");
                    return false;
                }
                //Entering value in Username Text box in Reward Adhoc token page

                if (!AdminTableObjects(adminBrowser, "Customer Search Criteria", "Username", "Text Box", custName, 1))
                {
                    Framework.BaseTest.CaptureScreenshot(adminBrowser, "");
                    Console.WriteLine("Unable to put value in Username Text box in Customer Search page");
                    return false;
                }
                adminBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);

                //click on the Find Customer button
                if (!AdminTableObjects(adminBrowser, "Customer Search Criteria", "", "Button", "Find Customer", 1))
                {
                    Framework.BaseTest.CaptureScreenshot(adminBrowser, "");
                    Console.WriteLine("Unable click on Find Customer button in Customer Search page");
                    return false;
                }
                _frameworkCommon.WaitUntilAllElementsLoad(adminBrowser);
                _frameworkCommon.WaitUntilElementPresent(adminBrowser, "//table//th/font[contains(text(),'Account information')]", FrameGlobals.PageLoadTimeOut);
                adminBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
                //verifying the customer name in page
                if (!adminBrowser.IsTextPresent(custName))
                {
                    Framework.BaseTest.CaptureScreenshot(adminBrowser, "");
                    Console.WriteLine("Unable to verify the customer name in the page");
                    return false;
                }
                Console.WriteLine("Successfully searched the customer");
                return true;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Framework.BaseTest.CaptureScreenshot(adminBrowser, "");
                return false;
            }
        }
开发者ID:hemap,项目名称:PhoenixAutomationRepo,代码行数:53,代码来源:Common.cs


注:本文中的ISelenium.WaitForPageToLoad方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。