本文整理汇总了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;
}
示例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);
}
}
}
}
示例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);
}
示例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);
}
示例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"));
}
示例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");
}
示例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();
}
示例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");
}