本文整理汇总了C#中IWebDriver.WaitClick方法的典型用法代码示例。如果您正苦于以下问题:C# IWebDriver.WaitClick方法的具体用法?C# IWebDriver.WaitClick怎么用?C# IWebDriver.WaitClick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWebDriver
的用法示例。
在下文中一共展示了IWebDriver.WaitClick方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
}
}
}
示例2: 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);
}
示例3: DeleteRole
public static void DeleteRole(IWebDriver driver, string roleName)
{
Login.AsHost(driver);
driver.Navigate().GoToUrl(SecurityRolesPage);
driver.WaitClick(RoleTableEditButton(roleName));
driver.WaitClick(EditSecurityRoleDeleteButton);
driver.WaitClick(EditSecurityRoleDeleteButtonConfirm);
}
示例4: AddUserToRole
public static void AddUserToRole(IWebDriver driver, string userName, string role)
{
Login.AsHost(driver);
driver.Navigate().GoToUrl(SecurityRolesPage);
driver.WaitClick(RoleTableManageUsersButton(role));
driver.WaitClick(UserRolesUserDropdown);
driver.WaitClick(UserRolesUserItem(userName));
driver.WaitClick(UserRolesAddUserToRoleButton);
}
示例5: SetRegistrationToPrivate
public static void SetRegistrationToPrivate(IWebDriver driver)
{
Login.AsHost(driver);
driver.Navigate().GoToUrl(SiteSettingsPage);
driver.WaitClick(UserAccountTab);
if (!driver.FindDnnElement(UserRegistrationTypeCheck).GetAttribute("class").Contains("dnnCheckbox-checked"))
{
driver.WaitClick(UserRegistrationTypePrivate);
driver.WaitClick(UpdateButton);
}
}
示例6: DisablePopups
public static void DisablePopups(IWebDriver driver)
{
Login.AsHost(driver);
driver.Navigate().GoToUrl(SiteSettingsPage);
driver.WaitClick(AdvancedTab);
driver.WaitClick(UsabilitySettings);
if (driver.FindDnnElement(UsabilitySettingPopUpCheck).GetAttribute("class").Contains("dnnCheckbox-checked"))
{
driver.WaitClick(UsabilitySettingPopUps);
driver.WaitClick(UpdateButton);
}
}
示例7: DeleteFirstUser
public static void DeleteFirstUser(IWebDriver driver)
{
Login.AsHost(driver);
driver.Navigate().GoToUrl(UserAccountsPage);
driver.WaitClick(AccountManagerDeleteButton);
driver.SwitchTo().Alert().Accept();
driver.SwitchTo().DefaultContent();
driver.WaitClick(AccountManagerRemoveButton);
driver.SwitchTo().Alert().Accept();
driver.SwitchTo().DefaultContent();
}
示例8: 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);
}
示例9: 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;
}
示例10: VerifyAdvancedFields
private static void VerifyAdvancedFields(IWebDriver driver)
{
driver.Navigate().GoToUrl(StartPage);
driver.WaitClick(DatabaseSetupType);
VerifyTextboxEditable(driver, DatabaseServer);
VerifyTextboxEditable(driver, DatabaseName);
VerifyTextboxEditable(driver, DatabaseObjectQualifier);
driver.WaitClick(DatabaseType);
VerifyTextboxEditable(driver, DatabaseFilename);
driver.WaitClick(DatabaseSecurity);
VerifyTextboxEditable(driver, DatabaseUsername);
VerifyTextboxEditable(driver, DatabasePassword);
}
示例11: 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");
}
示例12: 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();
}
示例13: VerifyRequiredFieldsBasic
private static void VerifyRequiredFieldsBasic(IWebDriver driver)
{
driver.Navigate().GoToUrl(StartPage);
driver.WaitClick(UsernameLabel);
Assert.That(driver.FindDnnElement(UsernameLabel).GetAttribute("class"), Is.StringMatching("dnnFormRequired"), "Username field does not have \"required\" class");
Assert.That(driver.FindDnnElement(PasswordLabel).GetAttribute("class"), Is.StringMatching("dnnFormRequired"), "Password field does not have \"required\" class");
Assert.That(driver.FindDnnElement(ConfirmPasswordLabel).GetAttribute("class"), Is.StringMatching("dnnFormRequired"), "Confirm Password field does not have \"required\" class");
Assert.That(driver.FindDnnElement(WebsiteNameLabel).GetAttribute("class"), Is.StringMatching("dnnFormRequired"), "WebsiteName field does not have \"required\" class");
Assert.That(driver.FindDnnElement(TemplateLabel).GetAttribute("class"), Is.Not.StringMatching("dnnFormRequired"), "Template field has \"required\" class when it shouldn't");
Assert.That(driver.FindDnnElement(LanguageLabel).GetAttribute("class"), Is.Not.StringMatching("dnnFormRequired"), "Language field has \"required\" class when it shouldn't");
}
示例14: VerifyRequiredFieldsAdvanced
private static void VerifyRequiredFieldsAdvanced(IWebDriver driver)
{
driver.Navigate().GoToUrl(StartPage);
driver.WaitClick(DatabaseSetupType);
Assert.That(driver.FindDnnElement(DatabaseServerLabel).GetAttribute("class"), Is.StringMatching("dnnFormRequired"), "Server Name field does not have \"required\" class");
Assert.That(driver.FindDnnElement(DatabaseServerLabel).GetAttribute("class"), Is.StringMatching("dnnFormRequired"), "Database Name field does not have \"required\" class");
Assert.That(driver.FindDnnElement(DatabaseObjectQualifierLabel).GetAttribute("class"), !Is.StringMatching("dnnFormRequired"), "Object Qualifier field has the \"required\" class and it shouldnt");
driver.WaitClick(DatabaseType);
Assert.That(driver.FindDnnElement(DatabaseFilenameLabel).GetAttribute("class"), Is.StringMatching("dnnFormRequired"), "Database File Name field does not have \"required\" class");
driver.WaitClick(DatabaseSecurity);
Assert.That(driver.FindDnnElement(DatabaseUsernameLabel).GetAttribute("class"), Is.StringMatching("dnnFormRequired"), "Database Username field does not have \"required\" class");
Assert.That(driver.FindDnnElement(DatabasePasswordLabel).GetAttribute("class"), Is.StringMatching("dnnFormRequired"), "Database Password field does not have \"required\" class");
}
示例15: VerifyTemplateDropdownContents
private static void VerifyTemplateDropdownContents(IWebDriver driver)
{
driver.Navigate().GoToUrl(StartPage);
driver.WaitClick(Template);
Assert.That(driver.FindDnnElement(TemplateDropdownList1).Text, Is.StringMatching("Default Template"), "First Item in template dropdown is not Default Template");
Assert.That(driver.FindDnnElement(TemplateDropdownList2).Text, Is.StringMatching("Mobile Template"), "Second Item in template dropdown is not Default Template");
Assert.That(driver.FindDnnElement(TemplateDropdownList3).Text, Is.StringMatching("Blank Template"), "Third Item in template dropdown is not Default Template");
}