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


C# IWebDriver.WaitSendKeys方法代码示例

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


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

示例1: CreateNewPortal

        public static void CreateNewPortal(IWebDriver driver, string portalName, By template)
        {
            Login.AsHost(driver);

            driver.Navigate().GoToUrl(SiteManagementPage);

            driver.WaitClick(CreatePortalButton);

            driver.WaitClick(AddSiteSiteTypeChildRadio);

            driver.FindDnnElement(AddSitePortalAliasTextbox).Clear();

            driver.WaitSendKeys(AddSitePortalAliasTextbox, "localhost/DotNetNuke_Enterprise/" + portalName + "/");

            driver.FindDnnElement(AddSitePortalAliasTextbox).Clear();

            driver.WaitSendKeys(AddSitePortalAliasTextbox, "localhost/DotNetNuke_Enterprise/" + portalName + "/");

            driver.WaitSendKeys(AddSitePortalNameTextbox, portalName);

            driver.WaitClick(AddSiteTemplateInput);
            driver.WaitClick(template);

            driver.WaitClick(AddSiteCreateSiteButton);

            int origTimeout = Common.DriverTimeout;
            Common.DriverTimeout = 30000;
            driver.WaitClick(AddSiteVisitNewPortalLink);
            Common.DriverTimeout = origTimeout;
        }
开发者ID:ryanmalone,项目名称:BGDNNWEB,代码行数:30,代码来源:SiteManagement.cs

示例2: AsUser

        public static void AsUser(IWebDriver driver, string user, string pass, string displayName)
        {
            try
            {
                if (driver.FindDnnElement(CurrentUserLink).Text.Contains(displayName))
                    Console.WriteLine("Already Logged in as:" + displayName);
                else
                    throw new Exception("Not logged in yet.");
            }
            catch (Exception)
            {
                Logoff(driver);

                driver.Navigate().Refresh();
                driver.WaitClick(LoginButton);

                driver.WaitSendKeys(LoginUserNameTextbox, user);
                driver.WaitSendKeys(LoginPasswordTextbox, pass);
                driver.WaitClick(LoginLoginButton);

                try
                {
                    var currentUser = driver.FindDnnElement(CurrentUserLink).Text;
                    Console.WriteLine(currentUser);
                }
                catch (NoSuchElementException)
                {
                    if (driver.FindDnnElement(LoginErrorMessage).Text.Contains("Login Failed") || driver.FindDnnElement(LoginErrorMessage).Text.Contains("Locked"))
                    {
                        Console.WriteLine("Failed to Log in: " + driver.FindDnnElement(LoginErrorMessage).Text);
                    }
                }
            }
        }
开发者ID:ryanmalone,项目名称:BGDNNWEB,代码行数:34,代码来源:Login.cs

示例3: CreateNewRole

        public static void CreateNewRole(IWebDriver driver, string roleName)
        {
            Login.AsHost(driver);

            driver.Navigate().GoToUrl(SecurityRolesPage);

            driver.WaitClick(AddNewRoleButton);
            driver.WaitSendKeys(EditSecurityRoleRoleNameTextbox, roleName);
            driver.WaitClick(EditSecurityRoleUpdateButton);
        }
开发者ID:ryanmalone,项目名称:BGDNNWEB,代码行数:10,代码来源:SecurityRoles.cs

示例4: AddNewUser

        public static void AddNewUser(IWebDriver driver, string username, string firstName, string lastName, string displayName, string email, string password)
        {
            Login.AsHost(driver);

            driver.Navigate().GoToUrl(UserAccountsPage);

            driver.WaitClick(AccountManagerAddNewUserButton);

            driver.WaitSendKeys(AddNewUserUsernameTextbox, username);
            driver.WaitSendKeys(AddNewUserFirstNameTextbox, firstName);
            driver.WaitSendKeys(AddNewUserLastNameTextbox, lastName);
            driver.WaitSendKeys(AddNewUserDisplayNameTextbox, displayName);
            driver.WaitSendKeys(AddNewUserEmailTextbox, email);
            driver.WaitClick(AddNewUserNotifyCheckbox);
            driver.WaitSendKeys(AddNewUserPasswordTextbox, password);
            driver.WaitSendKeys(AddNewUserConfirmPasswordTextbox, password);

            driver.WaitClick(AddNewUserAddNewUserButton);
        }
开发者ID:ryanmalone,项目名称:BGDNNWEB,代码行数:19,代码来源:UserAccounts.cs

示例5: RunTypicalInstall

        private static void RunTypicalInstall(IWebDriver driver)
        {
            driver.Navigate().GoToUrl(StartPage);

            driver.WaitSendKeys(Password, "dnnhost");
            driver.WaitSendKeys(ConfirmPassword, "dnnhost");

            driver.WaitClick(ContinueButton);

            for (int i = 0; i < 201; i++)
            {
                try
                {

                
                if (driver.FindElement(InstallStatus).Text.Contains("ERROR"))
                    Assert.Fail("Error found on install");

                if (i > 200)
                    Assert.Fail("Install Took longer than 5 minutes");

                if (!driver.FindElement(VisitSiteButton).GetAttribute("Class").Contains("dnnDisabledAction"))
                    break;

                }
                catch (NoSuchElementException){}

                Thread.Sleep(1000);
            }

            driver.WaitClick(VisitSiteButton);

            int oldTimeout = Common.DriverTimeout;
            Common.DriverTimeout = 120000;

            driver.WaitClick(LetMeAtItButton);

            SiteSettings.DisablePopups(driver);

            SiteManagement.SwitchToNewPortal(driver, "TestPortal");

            driver.WaitClick(LetMeAtItButton);

            Common.DriverTimeout = oldTimeout;

            Login.AsHost(driver);

            Assert.That(driver.FindDnnElement(CurrentUserLink).Text, Is.StringContaining("SuperUser"));
        }
开发者ID:ryanmalone,项目名称:BGDNNWEB,代码行数:49,代码来源:Installer.cs

示例6: VerifyPasswordTooShortError

        private static void VerifyPasswordTooShortError(IWebDriver driver)
        {
            driver.Navigate().GoToUrl(StartPage);

            driver.WaitSendKeys(Password, "abcdef");
            driver.WaitSendKeys(ConfirmPassword, "abcdef");
            driver.WaitClick(Username);

            Assert.That(driver.FindDnnElement(AdminError), !Is.StringContaining("Invalid Password"), "No error message on too short passwords");
        }
开发者ID:ryanmalone,项目名称:BGDNNWEB,代码行数:10,代码来源:Installer.cs

示例7: VerifyPasswordConfirmMatch

        private static void VerifyPasswordConfirmMatch(IWebDriver driver)
        {
            driver.Navigate().GoToUrl(StartPage);

            driver.WaitSendKeys(Password, "first");
            driver.WaitSendKeys(ConfirmPassword, "first");
            driver.WaitClick(Username);

            try
            {
                Assert.That(driver.FindDnnElement(AdminError), !Is.StringContaining("Passwords do not match"), "Error message on matching passwords");
            }
            catch (NoSuchElementException) { }

            Assert.Pass();
        }
开发者ID:ryanmalone,项目名称:BGDNNWEB,代码行数:16,代码来源:Installer.cs

示例8: VerifyPasswordConfirmNoMatch

        private static void VerifyPasswordConfirmNoMatch(IWebDriver driver)
        {
            driver.Navigate().GoToUrl(StartPage);

            driver.WaitSendKeys(Password, "first");
            driver.WaitSendKeys(ConfirmPassword, "second");
            driver.WaitClick(Username);

            //Wait for ajax call
            if (!driver.FindDnnElement(AdminError).Text.Contains("passwords do not match"))
                Thread.Sleep(1000);

            Assert.That(driver.FindDnnElement(AdminError).Text, Is.StringContaining("passwords do not match"), "Mismatched password error message missing");
        }
开发者ID:ryanmalone,项目名称:BGDNNWEB,代码行数:14,代码来源:Installer.cs


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