本文整理汇总了C#中IWebDriver.FindDnnElement方法的典型用法代码示例。如果您正苦于以下问题:C# IWebDriver.FindDnnElement方法的具体用法?C# IWebDriver.FindDnnElement怎么用?C# IWebDriver.FindDnnElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWebDriver
的用法示例。
在下文中一共展示了IWebDriver.FindDnnElement方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: VerifyCreatingNewRole
private static void VerifyCreatingNewRole(IWebDriver driver)
{
var rnd = new Random();
int rndNum = rnd.Next(9999);
CreateNewRole(driver, "TestRole" + rndNum);
Assert.That(driver.FindDnnElement(RoleTableItem("TestRole" + rndNum)).Text, Is.StringContaining("TestRole" + rndNum));
}
示例4: VerifyAddUser
private static void VerifyAddUser(IWebDriver driver)
{
var rnd = new Random();
int rndNum = rnd.Next(9999);
AddNewUser(driver, "TestAddUser" + rndNum, "TestAdd", "User", "TestAddUser" + rndNum, "TestAddUser" + rndNum + "@dnncorp.com", "testadduserpass");
Login.AsUser(driver, "TestAddUser" + rndNum, "testadduserpass");
Assert.That(driver.FindDnnElement(CurrentUserLink).Text, Is.StringContaining("TestAddUser" + rndNum), "User Not Added Correctly or not logged in");
}
示例5: VerifyCreatingChildSite
private static void VerifyCreatingChildSite(IWebDriver driver)
{
var rnd = new Random();
int rndNum = rnd.Next(9999);
CreateNewPortal(driver, "ChildSite" + rndNum, AddSiteTemplateDefaultItem);
driver.Navigate().GoToUrl(StartPage + "ChildSite" + rndNum + "/");
Assert.That(driver.FindDnnElement(LetMeAtItButton).Text, Is.StringContaining("Let me at it"));
}
示例6: VerifyAddNewSuperuser
private static void VerifyAddNewSuperuser(IWebDriver driver)
{
var rnd = new Random();
int rndNum = rnd.Next(9999);
var userName = "SuperMan" + rndNum;
var pass = "supermanPass";
AddNewSuperuser(driver, userName, "Super", "Man", userName, userName + "@dnncorp.com", pass);
Login.AsUser(driver, userName, pass);
Assert.That(driver.FindDnnElement(CurrentUserLink).Text, Is.StringContaining(userName));
}
示例7: 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);
}
}
示例8: 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);
}
}
示例9: VerifyRegisterUser
private static void VerifyRegisterUser(IWebDriver driver)
{
var rnd = new Random();
int rndNum = rnd.Next(9999);
Logoff(driver);
RegisterButton(driver).Click();
UsernameTextbox(driver).SendKeys("TestUser" + rndNum);
PasswordTextbox(driver).SendKeys("password#1");
ConfirmPasswordTextbox(driver).SendKeys("password#1");
DisplayNameTextbox(driver).SendKeys("TestUser" + rndNum);
EmailTextbox(driver).SendKeys("TestUser" + rndNum + "@dnncorp.com");
ContinueButton(driver).Click();
Assert.That(driver.FindDnnElement(CurrentUserLink).Text, Is.StringContaining("TestUser" + rndNum), "User Not registered or not logged in");
}
示例10: DisplayNameTextbox
public static IWebElement DisplayNameTextbox(IWebDriver driver) { return driver.FindDnnElement(By.Id("dnn_ctr_Register_userForm_DisplayName_DisplayName_TextBox")); }
示例11: ConfirmPasswordTextbox
public static IWebElement ConfirmPasswordTextbox(IWebDriver driver) { return driver.FindDnnElement(By.Id("dnn_ctr_Register_userForm_PasswordConfirm_PasswordConfirm_TextBox")); }
示例12: VerifyLogoIsVisible
private static void VerifyLogoIsVisible(IWebDriver driver)
{
driver.Navigate().GoToUrl(StartPage);
Assert.That(VerifyImageExists(driver.FindDnnElement(DotNetNukeLogo).GetAttribute("src")), "DotNetNuke Logo not present");
}
示例13: VerifyTextboxEditable
public static void VerifyTextboxEditable(IWebDriver driver, By byIn)
{
string origText = driver.FindDnnElement(byIn).Text;
driver.FindDnnElement(byIn).Clear();
driver.FindDnnElement(byIn).SendKeys("TestString");
Assert.That(driver.FindDnnElement(byIn).GetAttribute("value"), Is.StringMatching("TestString"));
driver.FindDnnElement(byIn).Clear();
driver.FindDnnElement(byIn).SendKeys(origText);
}
示例14: VerifySetResistrationToPublic
private static void VerifySetResistrationToPublic(IWebDriver driver)
{
SetRegistrationToPublic(driver);
var check = driver.FindDnnElement(UsabilitySettingPopUpCheck).GetAttribute("class");
SetRegistrationToPrivate(driver);
Assert.That(check, Is.StringContaining("dnnCheckbox-checked"));
}
示例15: VerifyDisablePopups
private static void VerifyDisablePopups(IWebDriver driver)
{
DisablePopups(driver);
Assert.That(driver.FindDnnElement(UsabilitySettingPopUpCheck).GetAttribute("class"), Is.Not.StringContaining("dnnCheckbox-checked"));
}