本文整理汇总了C#中ISelenium.GetXpathCount方法的典型用法代码示例。如果您正苦于以下问题:C# ISelenium.GetXpathCount方法的具体用法?C# ISelenium.GetXpathCount怎么用?C# ISelenium.GetXpathCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISelenium
的用法示例。
在下文中一共展示了ISelenium.GetXpathCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UnLockTheLockedUser
/// <summary>
/// Unlock the User which is locked
/// </summary>
/// Author: Anand
/// <param name="browser">browser Instance</param>
/// <param name="userName">User Name</param>
public void UnLockTheLockedUser(ISelenium browser, string userName)
{
decimal numberOfAciveRow;
string amend = "//input[@value='Amend Status Flags']";
// Enter Customer Name and Search
SearchCustomer(userName, browser);
// Click on Amend Status Flag
browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
SelectMainFrame(browser);
if (browser.IsElementPresent(amend))
browser.Click(amend);
System.Threading.Thread.Sleep(5000);
// Get Number of Active rows where user should be unlocked
numberOfAciveRow = browser.GetXpathCount("//tbody/tr[@class='active']");
if (numberOfAciveRow > 0)
{
for (int i = 0; i < numberOfAciveRow; i++)
{
browser.Click("link=[clear]");
browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
System.Threading.Thread.Sleep(5000);
browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
}
Console.WriteLine("AdminSuite:Common:UnLockTheLockedUser-Pass: User " + userName + " Unlocked ");
}
}
示例2: ReleaseSelfExcludedUser
/// <summary>
/// releases any SelfExcluded User
/// </summary>
/// Author: Anand
/// <param name="browser">Browser</param>
/// <param name="userName">User Name</param>
public void ReleaseSelfExcludedUser(ISelenium browser, string userName)
{
try
{
decimal numberOfSelfExcludedLink;
//Clicking on Event Link in LHN
LHNavigation(AdminSuite.CommonControls.AdminHomePage.CustomersLink, browser);
//Selecting TopFrame
SelectMainFrame(browser);
// Enter Customer Name and Search
SearchCustomer(userName, browser);
// Getting number of SelfExcluded Link
numberOfSelfExcludedLink = browser.GetXpathCount(AdminSuite.CustomerCreation.CustomersPage.NoOfSelfExcludedCustomer);
if (numberOfSelfExcludedLink > 0)
{
for (int i = 0; i < numberOfSelfExcludedLink; i++)
{
browser.Click(AdminSuite.CustomerCreation.CustomersPage.NoOfSelfExcludedCustomer);
browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
System.Threading.Thread.Sleep(10000);
if (!browser.IsTextPresent("Application Error"))
{
if (browser.IsElementPresent("//input[@type='submit' and @value='Confirm']"))
{
browser.Click("//input[@type='submit' and @value='Confirm']");
browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
System.Threading.Thread.Sleep(10000);
}
}
}
}
else
{
Console.WriteLine("AdminSuite:ReleaseSelfExcludedUser-Fail- Customer is not SelfExcluded");
}
Assert.IsTrue(browser.IsTextPresent("Self exclusion successfully removed"), "Failed to clear SelfExclusion for customer");
Console.WriteLine("AdminSuite:ReleaseSelfExcludedUser-Pass- Cleared the SelfExcluded");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}